ChatiumFor developersPlaygroundPricing
Sign in

refresh

Refreshes the screen with content from the server.

import { refresh } from "@app/ui"
refresh()

Examples


Displays the time that was present at the moment the screen was generated on the server. Pressing the button refreshes the screen and the time.

import { refresh } from '@app/ui'

app.screen('refresh', async (ctx, req) => {
  return (
    <screen>
      <text style={{alignSelf: 'center'}}>Time at the screen update: {new Date().toLocaleTimeString()}</text>
      <button title="Refresh" onClick={refresh()} />
    </screen>
  )
})