renderPage
Reference
renderPage(): Never
The renderPage
method is used to rerender the page inside a server action. Outside of an action, it throws an error.
renderPage
needs to be called outside of the try/catch
block:
import { renderPage } from "brisa/server";
// Inside a server action
function handleEvent() {
try {
// ...
} catch (error) {
// ...
}
// Trigger a full-page rerender
renderPage();
}
See the differences between "Action Signals" and
renderPage
in this documentation.
Parameters
withTransition
(optional): A boolean value that indicates whether the rerender should be done with start view transition. Default isfalse
.
Types:
function renderPage(): never;
Returns:
Never
does not require you to usereturn rerenderInPage()
due to using the TypeScriptnever
type.
Avoid using the
renderPage
inside atry/catch
block. Thenavigate
is a throwable function and will break the execution of the current function.
Support
Component | Support |
---|---|
Server Component | โ |
Web Component | โ |
SSR Web Component | โ |
Actions | โ |
Middleware | โ |
Response headers | โ |