UserContext

This commit is contained in:
Mikan
2025-06-01 21:39:44 +03:00
parent 35ed595edc
commit b5b2439bd8
6 changed files with 152 additions and 13 deletions

View File

@@ -0,0 +1,10 @@
import {Account} from "../../types/users.ts";
import {createContext} from "react";
export type UserContextType = {
user: Account | undefined;
login: (userData: Account) => void;
logout: () => void;
};
export const UserContext = createContext<UserContextType | undefined>(undefined);