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
forwardRefpattern
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.
Top comments (0)