We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b8669a commit a548ffbCopy full SHA for a548ffb
resources/js/hooks/use-mobile.tsx
@@ -1,11 +1,11 @@
1
-import * as React from 'react';
+import { useEffect, useState } from 'react';
2
3
const MOBILE_BREAKPOINT = 768;
4
5
export function useIsMobile() {
6
- const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
+ const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined);
7
8
- React.useEffect(() => {
+ useEffect(() => {
9
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
10
11
const onChange = () => {
0 commit comments