I made a useDarkMode hook that looks like this. It powers the "dark mode" support for all the Epic React workshop apps (for example React Fundamentals) I want to call out a few things about the hook itself that made things work well from a TypeScript perspective. Let's clear out all the extra stuff and just look at the important bits.
2 Comments
Sort: