DEV Community


Discussion on: I Used React Context To Enable Dark Mode

sanliverpool13 profile image
sanliverpool13 Author

Hey Philipp, thank you for the tip! Your code is much cleaner and makes much more sense for that function. Duly noted! And yes I understand your use of useCallback, so that the function is not redefined on every render of the component. Thank you for taking your time to read my article. Appreciate it!