Lifecycle
WochaLoading and WochaLoaded components for auth context lifecycle.
<WochaLoading> and <WochaLoaded> read provider loading state and render children only during the appropriate lifecycle phase. Use them to avoid layout shift while auth initialises.
Installation
pnpm add @wocha/ui @wocha/reactOr scaffold with the CLI
npx @wocha/cli init --framework nextjsWochaLoading
Renders children only while the auth context is loading.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Content shown during loading |
WochaLoaded
Renders children only after the auth context has finished loading.
| Prop | Type | Description |
|---|---|---|
children | ReactNode | Content shown after loading completes |
Combined pattern
Framework notes
| Framework | Behaviour |
|---|---|
| React SPA | isLoading is true until WochaProvider resolves the session |
| Next.js | isLoading reflects server session hydration in WochaSessionProvider |