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 is false.

Types:

function renderPage(): never;

Returns:

  • Never does not require you to use return rerenderInPage() due to using the TypeScript never type.

Avoid using the renderPage inside a try/catch block. The navigate 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 โŒ