Skip to main content

useAnnounce

Returns announce(message, { priority?, keep? }), which reads a message out through the app-wide live regions. The message is text or a Message from core, which is formatted with the active catalogue. Pass keep for the outcome of something the person did, so a later message cannot replace it while it waits for the throttle window. The function is stable between renders. Outside a LiveRegionProvider it does nothing, and warns once in development.

This is a function exported by @mapcairn/map, checked against version 0.2.0.

Signature​

import { useAnnounce } from "@mapcairn/map";

function useAnnounce(): Announce;

Returns​

Announce

See also​

Source: packages/map/src/ui/LiveRegion/LiveRegion.tsx:129