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.

4m read timeFrom kentcdodds.com
Post cover image
2 Comments

Sort: