(size: ViewSize)
| 44 | }; |
| 45 | |
| 46 | const useViewSize = (size: ViewSize): boolean => { |
| 47 | const check = useMedia( |
| 48 | [viewSizeToQuery[size].replace('@media ', '')], |
| 49 | [true], |
| 50 | false, |
| 51 | false, |
| 52 | ); |
| 53 | |
| 54 | return useMemo(() => { |
| 55 | return reversedEvaluatedSizes.includes(size) ? !check : check; |
| 56 | }, [check, size]); |
| 57 | }; |
| 58 | |
| 59 | // The phone shell swaps markup by viewport, so the server and the first |
| 60 | // client render must agree: both say "not a phone" and the answer lands |
no test coverage detected