useCommittedRef
API
import useCommittedRef from '@restart/hooks/useCommittedRef'
useCommittedRef
<TValue>(value: TValue) => MutableRefObject<TValue>Creates a
Ref
whose value is updated in an effect, ensuring the most recent value is the one rendered with. Generally only required for Concurrent mode usage where previous work inrender()
may be discarded before being used. This is safe to access in an event handler.Parameters
value
TValueThe
Ref
value
Return Value MutableRefObject<TValue>