[]previous and next page

useFlash

The one-time value the server set with setFlash for this page (read once; the server clears the cookie).

The one-time value the server set with setFlash for this page (read once; the server clears the cookie).

Import#

ts
import { useFlash } from "@shadow-js/dusk/client";

Signature#

ts
function useFlash<T = unknown>(): () => T | undefined

Returns#

An accessor of the value, undefined when there is none.

Examples#

ts
const notice = useFlash<string>();
<p>{notice()}</p>