Skip to content

Commit a548ffb

Browse files
authored
Simplify imports in useIsMobile hook (laravel#23)
* refactor: simplify imports in useIsMobile hook * Update quotation marks
1 parent 8b8669a commit a548ffb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

resources/js/hooks/use-mobile.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as React from 'react';
1+
import { useEffect, useState } from 'react';
22

33
const MOBILE_BREAKPOINT = 768;
44

55
export function useIsMobile() {
6-
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
6+
const [isMobile, setIsMobile] = useState<boolean | undefined>(undefined);
77

8-
React.useEffect(() => {
8+
useEffect(() => {
99
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
1010

1111
const onChange = () => {

0 commit comments

Comments
 (0)