fix error: window not defined

This commit is contained in:
dakai 2023-04-18 13:03:33 +08:00
parent 63544300f5
commit ebf0081cc1

View File

@ -159,7 +159,7 @@ function _Home() {
useSwitchTheme();
// the two useEffects are for enable animation of the sidebar collapse in mobile screen
const [width, setWidth] = useState(window.innerWidth);
const [width, setWidth] = useState(0);
useEffect(() => {
const handleResize = () => {