@winglet/react-utils
Version:
React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality
10 lines (9 loc) • 487 B
TypeScript
/**
* Memoizes the input value and preserves it throughout the component's lifetime.
* Similar to useMemo but with an empty dependency array, ensuring the value is computed only once.
* Useful for maintaining stable references to objects or expensive computations.
* @typeParam T - The type of the value to memoize
* @param input - The value to memoize
* @returns The memoized value that remains constant across re-renders
*/
export declare const useMemorize: <T>(input: T) => T;