The useRef Hook allows you to persist values between renders. First example would be to use the hook to update values without causing the component to re-render.
React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes.