Import this in your client-side component
MyComponent.tsx
import { useUUID, generateUUID } from "react-amazing-hooks";
API
Api | Description | Type | Return Type | Example |
---|---|---|---|---|
generateUUID | Function to generate a unique identifier. | options?: GenerateUUIDOptions | string | generateUUID({ prefix: 'id-', length: 16 }) |
useUUID | Custom hook used to generate a unique identifier. | options?: GenerateUUIDOptions | string | const id = useUUID({ length: 32 }); |
Check the GenerateUUIDOptions
in the 'Types' tab.