Design comparison
Solution retrospective
It's done ! Built with ReactJS, Flexbox, Custom properties and Styled Components ! I'll really be glad to have feedback especially on the right way to handle State const in UseEffect (warning => missing dependencies)
Third time using Styled Components instead of Sass or Pure CSS. I don't know if it takes a while to get used to it but I find it really takes a long time to write my CSS that way. Next time I will bring TailwindCSS :)
Community feedback
- @mickygingerPosted over 3 years ago
Hey Clément this looks great!
The
useEffect
hook in React will call the callback method every time one of the dependencies updates, so for example:useEffect(() => { console.log(newImageSrc) }, [])
In the code above
newImageSrc
will be logged to the console only once (on page load), and you may get a warning about missing dependencies.useEffect(() => { console.log(newImageSrc) }, [newImageSrc])
In this example the
newImageSrc
will be logged every time it changes. By putting the variable in the dependency array you are tellinguseEffect
that it is a dependency. Any variable or method that is used inside theuseEffect
callback is a dependency and should be included in the array.However you may not always want that (perhaps you only want the callback to be triggered when some of the dependencies change). There are several ways to handle that case outlined in this StackOverflow post
Aside from that, it might be nice to fix the height of the main descriptive paragraph, so that the links don't move around as you are interacting with the site.
I hope that's useful, and well done on the challenge! 🎉
2@ccreusatPosted over 3 years ago@mickyginger Thanks a lot ! I'm gonna look at this post and fix this. Same for the paragraph to avoid jumpy effect!
0 - @palgrammingPosted over 3 years ago
Congrats on being the first person to upload a attempt at this #GoodJob
1@ccreusatPosted over 3 years ago@palgramming Thanks man but I think I am the third person to upload it #private :)
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