useDarkMode Hook in React

import { useEffect } from 'react';
import useMediaQuery from './useMediaQuery';
import useLocalStorage from './useLocalStorage';
export default funciton useDarkMode() {
const defaultDarkMode = useMediaQuery(
['(prefers-color-scheme: dark)'],
[true],
false
);
};

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store