kripod/react-hooks

Add `useMedia` hook

kripod opened this issue · 2 comments

Motivation

Track whether a document matches the given media query. This may also be used for a usePreferredColorScheme (or useDarkMode) hook.

Basic example

const isDesktop = useMedia('(min-width: 1024px)');

Details

cmoog commented

The PR above implements this enhancement #11

Implemented by #11