diff --git a/src/module/_global/components/wrap_layout.tsx b/src/module/_global/components/wrap_layout.tsx index da1831a..ab53be2 100644 --- a/src/module/_global/components/wrap_layout.tsx +++ b/src/module/_global/components/wrap_layout.tsx @@ -2,13 +2,15 @@ import { useHookstate } from "@hookstate/core"; import { globalRole } from "../bin/val_global"; import { useShallowEffect } from "@mantine/hooks"; +import { useEffect } from "react"; export default function WrapLayout({ children, role }: { children: React.ReactNode, role: any }) { const roleLogin = useHookstate(globalRole) - useShallowEffect(() => { + useEffect(() => { roleLogin.set(role) - }, []) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [role]) return ( <> {children}