What is the diff useState vs useRef?
useStatecauses components to re-render after state updates whereasuseRefdoesn’t cause a component to re-render when the value or state changes. Essentially,useRefis like a “box” that can hold a mutable value in its (.current) property.useStateallows us to update the state inside components. WhileuseRefallows referencing DOM elements.