DEV Community

Cover image for 🚀 New Free React Challenge: New Way of Passing Ref
ReactChallenges
ReactChallenges

Posted on

🚀 New Free React Challenge: New Way of Passing Ref

A new free challenge is now available on ReactChallenges.com.

React 19 introduced a cleaner way to work with refs across components, reducing the need for forwardRef in many common scenarios.

This new exercise helps you practice that pattern with a real UI example.

What you'll build

A simple issue modal where users can:

  • Open the modal
  • Automatically focus the textarea when it appears
  • Close it with Cancel or Create

What you'll learn

  • How to create a ref in the parent component
  • How to pass a ref directly to a child component in React 19
  • How to control focus from outside the child component
  • How this compares to the previous forwardRef pattern

Why this matters

Refs are often needed for:

  • Modals
  • Search inputs
  • Forms
  • Custom UI primitives
  • Accessibility improvements

React 19 makes these interactions cleaner and easier to implement.

Try the challenge

👉 https://www.reactchallenges.com

Top comments (0)