Pergunta de entrevista da empresa Tata Consultancy Services

What is the difference between useState and useRef? When would you use useRef instead of useState?