Reference
/react
import { … } from "@johnmorrisdotca/hata/react";
4757.9 kB minified and gzipped, with everything it imports (measured with esbuild)
Exports
| Name | Kind | What it is |
|---|---|---|
BoundFlag | type | A flag ready to draw: its SVG with a style that fills the box, its proportions and the name a screen reader says. |
Flag | function | A flag, drawn inline: a <span role="img"> holding the flag's SVG, with the element's box (its height, proportions, round corners, border and shadow). |
FlagProps | type | What a binding's flag takes: the same as <hata-flag>'s attributes. |
preloadFlags | function | Load flags before a render that cannot wait: a server render to a string, a static build, the first render on the client that must match it. |
useFlag | function | The flag of a component's props, as a hook: the flag if it is already loaded (preloadFlags), else it is loaded: React 19 suspends until it is, and React 18 draws nothing until an effect has loaded it. |