Design comparison
Solution retrospective
Hi everyone!
This is my first React based challenge. I have tried my best to complete this challenge as per my knowledge, if you think this could be done better then please do not hesitate to reply, I will take care of all the suggestions and try to implement in my future projects.
Happy Coding😊
Community feedback
- @DavidMorgadePosted over 2 years ago
Hello Madan Shina congrats on finishing the challenge!
Your component seems to work perfectly and adjust correctly to the UI, let me give you some advices for React that maybe can help you in the future. Some of this advices are bit of an overkill for a little application like this one, but practicing them can help you a lot when building bigger React Apps.
-
Instead of having all your code on Rating.js, try building each component apart and then rendering in your main component, this will make your code more readable and structured, instead of having a big chunk file with all the JSX inside!
-
Don't use globals style to style every component like in a normal html, css, javascript project, try using either CSS modules or Styled Components, you can learn more of them clicking on the links, my preferred option is styled components since they are easy to pass props, change styles, reuse them, but CSS modules are also a great approach (you can use them with SCSS too)
-
You don't need to
import React from 'react'
, this was added like 1 or 2 years ago, there is no longer the need to do it!, you can just import parts of react likeimport {useState} from 'react'
and so on!
Hope my feedback helps you in future challenges, don't hesitate to ask any question, good job!
Marked as helpful2@lazy4gyanPosted over 2 years ago@DavidMorgade Thank you for valuable feedback, I will implement this in future challenges.
1 -
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord