Advanced React

Join the React Bootcamp

The React Bootcamp is 5 full weeks of professional React training to take you from wherever you are to top-tier React programmer in record time.

Lifetime Access

$99.00
Complete Package
Solution

Input Focus Solution

Use the "Focus" button focus the input with the help of a ref that you connect with the underlying input element.

Note that you can focus any input using the focus method.

This lesson is part of the full version of the React Bootcamp. Already joined? Log in here

Transcript

In this component, we have a simple form that consists of an input as well as this button with the text focus.

Your challenge here is going to consist of focusing the input.

When we click on this button, the first thing that you'll need to do is change the button from type submit to type button...