7)What is the difference between useRef and useState? When would you choose one over the other?
useState


To store data that affects the UI and needs re-rendering when changed.
When the value changes, the component re-renders automatically.
Value is updated using the setter function (e.g., setCount).
Commonly used for dynamic UI data (like...