Design comparison
Solution retrospective
Hi everyone!
I would appreciate some feedback on this.
I got stuck when I finished the project and realized that the challenge asked to reset the form after clicking the continue button.
The form was easy, but the card… as I’m new to React I struggled to update the context through the component that is consuming it, so after many unsuccessful tries I decided to throw a 'window.location.reload()' there and move on.
But… I was not happy with that and then figured out how to update the context and reset the information that was left on the card, my question is:
"window.location.reload()" did the job and just took 1 line, against 10+ using context to achieve the same behavior. Is there a better way to update the state inside a context or should I just have used the "window.location.reload()" and done?
Community feedback
- @markuslewinPosted about 2 years ago
This comment was deleted about 2 years ago
0@allfigueiredodevPosted about 2 years ago@markuslewin
Hi Markus!
Thank you for the feedback, I will certainly make those changes!
Your tip will help me a lot from now on, when I was doing the challenge I notice that it was kinda redundant, but I didn't know better. Thank you for clarifying that.
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