Skip to content

Instantly share code, notes, and snippets.

@negarjf
Last active January 1, 2021 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save negarjf/53f6b8a6dd03e8101090ac1572d9be60 to your computer and use it in GitHub Desktop.
Save negarjf/53f6b8a6dd03e8101090ac1572d9be60 to your computer and use it in GitHub Desktop.
UserProvider step 1
import React, {createContext, useReducer} from 'react';
import initialState from "./initialState";
import reducer from "./reducer";
import useActions from "./useActions";
export const UserContext = createContext();
export const UserProvider = ({children}) => {
const value = {user: null};
return (
<UserContext.Provider value={value}>
{children}
</UserContext.Provider>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment