See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| function useMedia(query) { | |
| const [matches, setMatches] = useState(window.matchMedia(query).matches) | |
| useEffect(() => { | |
| const media = window.matchMedia(query) | |
| if (media.matches !== matches) { | |
| setMatches(media.matches) | |
| } | |
| const listener = () => { | |
| setMatches(media.matches) |