Interactive Rating Component using React(Class Component)
Design comparison
Solution retrospective
It took me some time to get the hang of lifting the state up concept in react.
Community feedback
- @visualdennissPosted over 1 year ago
Hey there,
great job getting the functionality and design implemented successfully!
I've checked your React Code and it looks like you are using class components and what i've noticed is that the amount of line of code it required just to get a simple task done. My suggestion would be to use Functional React Components for a way shorter code and a fast way. You would only need to use a simple line to hold the state with a useState hook and simply render the components conditionally in a much concise way. Of couse this is a matter of preference and nothing wrong with your solution. But i was just surprised to see how much line of code it takes with class components, as i've also done the challenge but with functional components. So i thought i share my suggestion :)
Hope you find this feedback helpful!
0 - @0xabdulkhaliqPosted over 1 year ago
Hello there π. Congratulations on successfully completing the challenge! π
- I have other recommendations regarding your code that I believe will be of great interest to you.
HTML π·οΈ:
- This solution generates accessibility error reports due to
non-semantic
markup, which lack landmark for a webpage
- So fix it by replacing the element
<div id="root">
the with semantic element<main>
in yourindex.html
file to improve accessibility and organization of your page.
- What is meant by landmark ?, They used to define major sections of your page instead of relying on generic elements like
<div>
or<span>
- They convey the structure of your page. For example, the
<main>
element should include all content directly related to the page's main idea, so there should only be one per page
I hope you find this helpful π Above all, the solution you submitted is great !
Happy coding!
0
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