Stub context properties and methods

This commit is contained in:
jwu-fisker
2021-01-05 12:06:23 -08:00
parent ec653ca530
commit c593b2dfc4
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import React, { useContext, useEffect, useState } from 'react';
const UserContext = React.createContext();
export const UserProvider = ({ children }) => {
const [signedIn, setSignedIn] = useState(false);
const [user, setUser] = useState(null);
const [token, setToken] = useState(null);
const [signInError, setSignInError] = useState(null);
const [signUpError, setSignUpError] = useState(null);
const signIn = (email, password) => {
};
const signUp = (email, password, confirmPassword) => {
};
return (
<UserContext.Provider value={{
signedIn,
user,
token,
signInError,
signUpError,
signIn,
signUp,
}}>
{children}
</UserContext.Provider>
);
};
export const useUserContext = () => useContext(UserContext);