@auth0/auth0-react
    Preparing search index...

    Function useAuth0Suspense

    • <Suspense fallback={<Spinner />}>
      <Profile />
      </Suspense>

      function Profile() {
      const { user, isAuthenticated } = useAuth0Suspense();
      return isAuthenticated ? <p>Hello {user.name}</p> : <p>Please log in</p>;
      }

      Suspense-enabled variant of useAuth0. Suspends the component until Auth0 initialization completes (letting the nearest <Suspense> fallback render), and throws initialization errors so the nearest Error Boundary can handle them. Requires React 19 or later.

      If initialization fails and the app later becomes authenticated by other means, the session is re-checked once; retrying the Error Boundary then renders if that check succeeded, or throws again if it did not.

      TUser is an optional type param to provide a type to the user field.

      Type Parameters

      Parameters

      Returns Auth0SuspenseContextInterface<TUser>