Options
All
  • Public
  • Public/Protected
  • All
Menu

Module with-auth0

Index

Interfaces

Functions

Functions

Const default

  • default<P>(Component: ComponentType<P>): ComponentType<Pick<P, Exclude<keyof P, "auth0">>>
  • class MyComponent extends Component {
      render() {
        // Access the auth context from the `auth0` prop
        const { user } = this.props.auth0;
        return <div>Hello {user.name}!</div>
      }
    }
    // Wrap your class component in withAuth0
    export default withAuth0(MyComponent);
    

    Wrap your class components in this Higher Order Component to give them access to the Auth0Context

    Type parameters

    Parameters

    • Component: ComponentType<P>

    Returns ComponentType<Pick<P, Exclude<keyof P, "auth0">>>