Skip to main content

Page Action | Reload

Use page.reload() to reload your app.

This is useful if you want to refresh the page or reset the data on the page.

import { Compose, Page, UI } from "@composehq/sdk";

async function handler({ page, ui }: { page: Page, ui: UI }) {
const randomNumber = Math.floor(Math.random() * 100)

page.add(() => ui.text(`Random number: ${randomNumber}`))
page.add(() => ui.button("reload", {
onClick: () => page.reload()
}))
}

API reference

Function signature

page.reload(): void

Parameters

None.

Returns

void