Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Native

App Context

The AppContext is a React context provided by AppContainer that stores global objects and methods used throughout your application, such as:

Info

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, Button } from '~/components/lib'

export function Profile(props){

  const context = useContext(AppContext);
  return <Button text='Sign out' action={context.auth.signout} />;

}