Skip to content

Commit

Permalink
useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Sep 11, 2023
1 parent c7e0152 commit 350ec9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useHandleResize.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useLayoutEffect } from "react";
import { useEffect } from "react";
import { useSidebarStore } from "~/utils/store";

// Create a custom hook
export const useHandleResize = () => {
const { setOpenState } = useSidebarStore();

useLayoutEffect(() => {
useEffect(() => {
const handleResize = () => {
if (window.innerWidth >= 768) return setOpenState(true);

Expand Down

0 comments on commit 350ec9e

Please sign in to comment.