Edit It: Do refs in React persist during re-rendering?
This code shows that a ref's value persists during re-rendering but modifying it does not cause React to re-render the component.
See it on StackBlitzThis code shows that a ref's value persists during re-rendering but modifying it does not cause React to re-render the component.
See it on StackBlitz