8471 shaares
203 private links
203 private links
import { v4 as uuidv4 } from 'uuid'
export const useId = () => {
const prefix = uuidv4()
const $id = (name: string) => `${prefix}-${name}`
return { $id }
}
It can work with the crypto module too.