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
renderPagein 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:
Neverdoes not require you to usereturn rerenderInPage()due to using the TypeScriptnevertype.
Avoid using the
renderPageinside atry/catchblock. Thenavigateis 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 | โ |