Skip to content

Instantly share code, notes, and snippets.

@ryanbelke
Last active May 7, 2020 00:04
Show Gist options
  • Select an option

  • Save ryanbelke/70db6d12f9a33a7fb9347f71742697a4 to your computer and use it in GitHub Desktop.

Select an option

Save ryanbelke/70db6d12f9a33a7fb9347f71742697a4 to your computer and use it in GitHub Desktop.
create default AppContext state
/* /context/AppContext.js */
import React from "react";
// create auth context with default value
// set backup default for isAuthenticated if none is provided in Provider
const AppContext = React.createContext({ isAuthenticated: false });
export default AppContext;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment