Shadcn Hooks

useCreation

A hook to create a value only once

Loading...

Installation

npx shadcn@latest add @shadcnhooks/use-creation

API

/**
 * A hook to create a value only once
 * @param factory - The factory function to create the value
 * @param deps - The dependencies to create the value
 * @returns The created value
 */
export function useCreation<T>(factory: () => T, deps: DependencyList): T

Credits

Last updated on

On this page