fixed eslint warnings

This commit is contained in:
2022-03-13 18:08:33 -07:00
parent b86d51d4c1
commit 353472b7a1
5 changed files with 39 additions and 24 deletions
+15 -10
View File
@@ -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;