fix: wrap layout
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user