Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/react-hooks. A collection of React Hooks.
hooks react react-hooks
Something went wrong. Try again.
392 B · 11 lines
TypeScript
at main
123456789101112import useMatchMedia from './useMatchMedia.js';
/** * Returns a flag which determines if the document matches `(prefers-color-scheme: dark)` media * feature. * * @returns {boolean} Whether the document matches `(prefers-color-scheme: dark)` media feature */export default function usePrefersColorSchemeDark(): boolean | null { return useMatchMedia('(prefers-color-scheme: dark)');}