App Context
import { useContext } from 'react';
import { AppContext } from '~/components/lib'
export function Profile(props){
const context = useContext(AppContext);
context.handleError(err);
}Last updated
The AppContext is a higher-order component (HOC) that stores global objects and methods used throughout your application, such as:
user credentials
authentication methods (sign in, authorizeUser, signout)
notification banner methods (show, hide)
modal methods (show, hide)
The AppContext is located in /components/app
You can then use any of these methods anywhere in your application by importing the AppContext into your components.
import { useContext } from 'react';
import { AppContext } from '~/components/lib'
export function Profile(props){
const context = useContext(AppContext);
context.handleError(err);
}Last updated