update state with useref code example
Example: use state vs use ref
Source: https://stackoverflow.com/a/56456055
The main difference between both is : useState causes re-render, useRef does not.
Source: https://stackoverflow.com/a/56456055
The main difference between both is : useState causes re-render, useRef does not.