Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Rating Component using React(Class Component)

umer zaheerβ€’ 160

@umernk42

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


It took me some time to get the hang of lifting the state up concept in react.

Community feedback

P
visualdennisβ€’ 8,375

@visualdenniss

Posted

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
Abdul Khaliq πŸš€β€’ 72,620

@0xabdulkhaliq

Posted

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 your index.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 GitHub
Discord logo

Join 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