Design comparison
Solution retrospective
I would appreciate some feedback on how readable / usable my code is
Community feedback
- @MikevPeerenPosted almost 3 years ago
Hey 👋
Looks good to me, the only thing I can think about is that you could perhaps have predefined arrays with key value pairs this way you can just select your element for example for the housselection like:
Sethouse = Array[num]
And perhaps it would be cleaner to have two states one for the name and image.
Also useStates should always be ordered at the top so the function in between is a no go.
I would also have maybe a custom hook for your localstoragd to handle that.
But for the rest good job
Marked as helpful1@b-a-merrittPosted almost 3 years ago@MikevPeeren
Thanks so much! I had the useStates defined at the top before, but then second-guessed myself, reorganizing the state to put them nearer where they are used.
I'll be spending some time getting comfortable with custom hooks, and will go back and change that.
Thanks again!
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