Skip to content

Instantly share code, notes, and snippets.

@nightspirit
Last active February 16, 2019 08:56
Embed
What would you like to do?
import { createContext, useReducer } from 'react'
import AppReducer from 'Reducers/AppReducer'
import { BrowserRouter } from 'react-router-dom'
import Routes from 'Routes'
export const AppReducerContext = createContext()
const initState = AppReducer()
export default function App () {
const appReducer = useReducer(AppReducer, initState)
return (
<AppReducerContext.Provider value={appReducer}>
<BrowserRouter>
<Routes />
</BrowserRouter>
</AppReducerContext.Provider>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment