updated NPED code
This commit is contained in:
17
src/context/providers/NPEDUserContextProvider.tsx
Normal file
17
src/context/providers/NPEDUserContextProvider.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useState, type ReactNode } from "react";
|
||||
import type { NPEDUser } from "../../types/types";
|
||||
import { NPEDUserContext } from "../NPEDUserContext";
|
||||
|
||||
type NPEDUserProviderType = {
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export const NPEDUserProvider = ({ children }: NPEDUserProviderType) => {
|
||||
const [user, setUser] = useState<NPEDUser | null>(null);
|
||||
|
||||
return (
|
||||
<NPEDUserContext.Provider value={{ user, setUser }}>
|
||||
{children}
|
||||
</NPEDUserContext.Provider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user