Skip to content

Instantly share code, notes, and snippets.

@popeating
Created August 4, 2020 19:06
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 popeating/bac25b92c5860c9f0d935a038fc587c0 to your computer and use it in GitHub Desktop.
Save popeating/bac25b92c5860c9f0d935a038fc587c0 to your computer and use it in GitHub Desktop.
import React, { createContext } from 'react';
const mainContext = createContext();
export default mainContext;
//In App.js
return (
<mainContext.Provider value={mainC}> //mainC will be defined in next step
//Resto of code
</mainContext.Provider>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment