@rjsf/utils
Version:
Utility functions for @rjsf/core
9 lines (8 loc) • 420 B
TypeScript
/** Hook that stores and returns a `T` value. If `newValue` is the same as the stored one, then the stored one is
* returned to avoid having a component rerender due it being a different object. Otherwise, the `newValue` is stored
* and returned.
*
* @param newValue - The potential new `T` value
* @returns - The latest stored `T` value
*/
export default function useDeepCompareMemo<T = unknown>(newValue: T): T;