--:--









Quiz for Refs and DOM Manipulation

Course: REACT | Subject: React | Topic: Advanced React Concepts



Logo

Q1: What is the purpose of refs in React?

Logo

Q2: How do you create a ref in a class component?

Logo

Q3: How do you create a ref in a functional component?

Logo

Q4: What is the value of a ref after it is attached to an input element?

Logo

Q5: Can refs be used to modify child component state?

Logo

Q6: Which attribute is used to attach a ref to a DOM element?

Logo

Q7: Are refs reactive? Do they cause re-render when updated?

Logo

Q8: What is an example use case for refs?

Logo

Q9: Can refs be used with functional components directly?

Logo

Q10: How can you pass refs to functional components?

Logo

Q11: What does React.forwardRef() do?

Logo

Q12: Which hook would you use to store a mutable value that does not cause re-renders?

Logo

Q13: Can refs be used to trigger animations?

Logo

Q14: What should you avoid when using refs?

Logo

Q15: Which is true about callback refs?

Logo

Q16: How do you clear a ref’s current value?

Logo

Q17: Which method do refs bypass?

Logo

Q18: How does useRef differ from useState?

Logo

Q19: When might refs be necessary?

Logo

Q20: Which of these is NOT a recommended use of refs?

Are you ready to start test? Set your time limit