$ npm install react-hook-dark-mode
A React Hook to check whether the OS dark mode has been turned on.
import useIsDark from 'react-hook-dark-mode'; { const isDark = ; return <div ="App"> <h1>Color scheme: isDark ? "dark" : "light"</h1> </div> ;}
Try it out here!