Skip to content

Instantly share code, notes, and snippets.

@Jahans3
Created November 29, 2018 19:35
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 Jahans3/fdad0fa6aa931f7f305bb97161d3c91b to your computer and use it in GitHub Desktop.
Save Jahans3/fdad0fa6aa931f7f305bb97161d3c91b to your computer and use it in GitHub Desktop.
Using StateProvider
import { StateProvider } from './stateContext';
import MyApp from './MyApp';
const initialState = {
count: 0
};
export default function Root () {
return (
<StateProvider state={initialState}>
<MyApp />
</StateProvider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment