From b3f1e13d102c0fa60d3c49359e2157438d863e89 Mon Sep 17 00:00:00 2001 From: amel Date: Thu, 12 Sep 2024 15:55:45 +0800 Subject: [PATCH] fix: wrap layout --- src/module/_global/components/wrap_layout.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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}