forwardRef Quiz

Test your knowledge of React forwardRef, ref forwarding, imperative handles, reusable components, and the React 19 ref-as-prop change.

20 questions · free · answers explained

Start the quiz

All questions in this quiz

  1. What does forwardRef let a React component do?
  2. Which package exports forwardRef?
  3. What are the arguments passed to a forwardRef render function?
  4. What is a common use case for forwardRef?
  5. What happens if a forwardRef component receives a ref but never passes it anywhere?
  6. What does useImperativeHandle let a forwardRef component expose?
  7. Why might exposing a full DOM node through a ref be a tradeoff?
  8. For which components is ref forwarding most commonly appropriate?
  9. What should you usually prefer if behavior can be expressed declaratively?
  10. How does Strict Mode affect the forwardRef render function in development?
  11. In React 19, what changed about refs for function components?
  12. Why is forwardRef still useful to understand?
  13. What should a forwardRef component usually do with other props?
  14. What is a common TypeScript concern with forwardRef?
  15. What does the parent receive when useImperativeHandle exposes custom methods?
  16. Which imperative behavior is a reasonable ref use case?
  17. What is a common mistake when forwarding refs through multiple components?
  18. Can forwardRef return a component that is rendered in JSX?
  19. What is the ref value before a DOM element is mounted?
  20. Which pattern best limits what a parent can do with a child input?

Prefer to read first? React interview questions with written answers.