Archived
fixed eslint warnings
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import { createContext, useState } from "react";
|
||||
|
||||
const AuthContext = createContext({});
|
||||
|
||||
export const AuthProvider = ({ children }: {children: any}) => {
|
||||
const [auth, setAuth] = useState({});
|
||||
|
||||
return (
|
||||
<AuthContext.Provider value={{ auth, setAuth }}>
|
||||
{children}
|
||||
</AuthContext.Provider>
|
||||
)
|
||||
interface loginInfo {
|
||||
username: string;
|
||||
isLoggedIn: boolean;
|
||||
}
|
||||
|
||||
const AuthContext = createContext<loginInfo>({username: "", isLoggedIn: false});
|
||||
|
||||
export const AuthProvider = ({ children }: {children: React.ReactNode}) => {
|
||||
const [auth] = useState<loginInfo>({username: "", isLoggedIn: false});
|
||||
|
||||
return (
|
||||
<AuthContext.Provider value={auth}>
|
||||
{children}
|
||||
</AuthContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default AuthContext;
|
||||
Reference in New Issue
Block a user