Design comparison
SolutionDesign
Solution retrospective
Hi everyone!
That's been a tough one! Any feedback is appreciated 🙌😍
Community feedback
- @fazzaamiarsoPosted over 2 years ago
Hello Nika! Great solution and clean code overall!
Here is a quick tip. You should always have a clean-up function for the listener.
useEffect(()=> { const resizeFn = () => setWidth(window.innerWidth) window.addEventListener("resize", resizeFn) return () => window.removeEventListener("resize", resizeFn) }, [])
I hope it's useful! Cheers!
Marked as helpful1@nika-sergeevaPosted over 2 years ago@fazzaamiarso Thanks a lot! I forgot to write it. =)
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