Skip to content
Submitted about 1 year ago

interactive comments section with React

react, sass/scss, tailwind-css, typescript, vitest
LVL 4
@toshirokubota
A solution to the Interactive comments section challenge

Solution retrospective


What challenges did you encounter, and how did you overcome them?

I was having a problem with double form submission. When I make a new comment, it creates another empty comment. The problem seems that the submission handler updates two states, and the strict mode of React ended up running the submission twice. I could be wrong with the cause, but I ended up preventing an empty comment from being sent. There is probably a better way to deal with the situation, though.

I tried to cover as much functionality of the app by integration testing. However, it was a slow moving process and I could not finish as much as I wanted to. Hopefully, as I get used to the testing framework (vitest + testing-library), I will be able to do it more efficiently in the future.

What specific areas of your project would you like help with?

I will be grateful for any comments/suggestions on improving the design and the implementation.

Code
Loading...

Please log in to post a comment

Log in

Community feedback

No feedback yet. Be the first to give feedback on toshirokubota’s solution.

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