()
| 9 | let mounted = true |
| 10 | const mql = window.matchMedia(query) |
| 11 | const onChange = () => { |
| 12 | if (!mounted) { |
| 13 | return |
| 14 | } |
| 15 | setState(!!mql.matches) |
| 16 | } |
| 17 | |
| 18 | mql.addEventListener('change', onChange) |
| 19 | setState(mql.matches) |
nothing calls this directly
no outgoing calls
no test coverage detected