CheckForApplicationUpdate
Polls the deployed page and shows a notification once a new build is live. Renders nothing until then.
Installation
pnpm dlx shadcn@latest add @chelone/check-for-application-updatePolls the deployed page and shows a notification once a new build is live. Renders nothing until then.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| disabled | boolean | — | Never fetch. Defaults to `true` outside production. |
| fetchOptions | RequestInit | () => RequestInit | — | Read at each check. `cache: "no-store"` always overrides it. |
| interval | number | — | Milliseconds between checks. Defaults to one hour. |
| notification | ReactNode | — | Shown once a new build is found. Defaults to `<ApplicationUpdatedNotification />`. |
| onNewVersionAvailable | () => void | — | Called once, when the first change is seen. |
| url | string | — | Page to fingerprint. Defaults to `${location.origin}/index.html`, read at each check. |