plane/space/lib/user-provider.tsx

13 lines
355 B
TypeScript
Raw Normal View History

2024-05-18 10:52:53 +00:00
import { ReactNode } from "react";
import { observer } from "mobx-react-lite";
import useSWR from "swr";
import { useUser } from "@/hooks/store";
export const UserProvider = observer(({ children }: { children: ReactNode }) => {
const { fetchCurrentUser } = useUser();
useSWR("CURRENT_USER", () => fetchCurrentUser());
return <>{children}</>;
});