Beta
A hook for doing side effects as a response to a change in a hook value between renders
The value you want to respond to changes in.
Callback to run when the value changes.
Optional
useDidUpdate(hasFocus, (hadFocus, hasFocus) => { if (hasFocus) { scrollIntoView(elementRef.current) }}) Copy
useDidUpdate(hasFocus, (hadFocus, hasFocus) => { if (hasFocus) { scrollIntoView(elementRef.current) }})
A hook for doing side effects as a response to a change in a hook value between renders