useId
useId hook provides a simple way to create unique ids.Import
import { useId } from "@prismane/core/hooks";
Usage
function Demo() { const id = useId(); return ( <Text cl={(theme) => (theme.mode === "dark" ? ["base", 200] : ["base", 700])} > Refresh to regenerate id: {id} </Text> ); }
API
Return Value
Name | Type | Description |
---|---|---|
id | string | The generated id. |