Typically we use hooks like useState which are controlled in that they store data within state. Whenever data stored in state changes, the component is re-rendered.
In order to avoid re-rendering, we cannot store data in state - this is referred to as uncontrolled. the useRef hook allows us to do this by storing data separately from the state and avoiding re-renders
Typically we use hooks like useState which are controlled in that they store data within state. Whenever data stored in state changes, the component is re-rendered.
In order to avoid re-rendering, we cannot store data in state - this is referred to as uncontrolled. the useRef hook allows us to do this by storing data separately from the state and avoiding re-renders