import React, { useState } from 'react' export const AuthenticationContext = React.createContext({ authenticated: false, login: () => { }, logout: () => {} }) const AuthenticationContextProvider = (props) => { const [authenticated, setAuthenticated] = useState(false) const loginHandler = () => { setAuthenticated(true) } const logoutHandler = () => { setAuthenticated(false) } return ( {props.children} ) } export default AuthenticationContextProvider