import React from 'react'; import { User } from '@auth0/auth0-spa-js'; import { Auth0ContextInterface } from './auth0-context'; /** * The value returned by `useAuth0Suspense`: the full `useAuth0` interface minus * `isLoading` and the internal `_initPromise`. `error` is * retained for post-init failures such as `loginWithPopup`. */ export type Auth0SuspenseContextInterface = Omit, 'isLoading' | '_initPromise'>; /** * ```jsx * }> * * * * function Profile() { * const { user, isAuthenticated } = useAuth0Suspense(); * return isAuthenticated ?

Hello {user.name}

:

Please log in

; * } * ``` * * Suspense-enabled variant of `useAuth0`. Suspends the component until Auth0 * initialization completes (letting the nearest `` 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. */ declare const useAuth0Suspense: (context?: React.Context>) => Auth0SuspenseContextInterface; export default useAuth0Suspense; //# sourceMappingURL=use-auth0-suspense.d.ts.map