A custom React hook that provides a stable default value for a potentially undefined reactive value.
The defaultValue is memoized upon component mount and remains unchanged until the component unmounts,
ensuring stability across all re-renders, even if the defaultValue prop changes.
Note: The defaultValue is not reactive. It retains the same value from the component's mount to unmount.
A custom React hook that provides a stable default value for a potentially undefined reactive value. The defaultValue is memoized upon component mount and remains unchanged until the component unmounts, ensuring stability across all re-renders, even if the defaultValue prop changes.
Note: The defaultValue is not reactive. It retains the same value from the component's mount to unmount.