Skip to main content

Module context

Module context 

Source
Expand description

The request’s Livewire state, reached through the framework’s context instead of a static.

Upstream Livewire keeps its render stack, component stack, and pending effects in PHP statics and weak maps, which one request can leak into another on a long-lived worker. Here one LivewireRequest per request holds the same state, created on first use in the framework’s request-local store.

The state is lock-protected, so never hold a guard across an .await or a nested render: take what you need from the state, release the lock, then render.

Structs§

Child
One nested component a parent rendered, as the parent’s memo records it.
ComponentState
The state one component has within one request: what it rendered, and what it asks the browser to do.
Download
A file the browser downloads instead of rendering the component.
LivewireRequest
One request’s mutable Livewire state.
PageContext
The page a component was rendered from.
StackGuard
Pops a stack when dropped, so a failed render cannot leave a component on it.
Stream
One chunk a streamed component sent before its final response.