@Sloth247
Posted
Hi JibbyCodes, this is the best solution that I've ever seen on FEM for this challenge. I may need to revise my coding based on your solution 😁 I'm sorry if I am wrong but the useEffect for the theme in your context file should be "useLayoutEffect". I did a bit of research after finishing my solution and according to official React documentation, "useLayoutEffect will be flushed synchronously, before the browser has a chance to paint.", so this hook might be good to use there.
I appreciate if you give me feedback on my solution too 😊
Your solution is really nice.
Marked as helpful
@Kijimai
Posted
@Sloth247 Hi Sloth! Thank you for your comment, and after looking over about the differences between the two (useEffect and useLayoutEffect) I might just refactor my solution to accommodate that as well! I've never used useLayoutEffect before but I will definitely start considering applying that in future projects from now on.
I'll take a look at your solution as well and maybe I can learn a thing or two from yours!
@Sloth247
Posted
@Kijimai Thank you very much 🤩