Ref Demo - Focus

How this works

When the page loads, we use firstNameRef.current.focus() to set focus on the First Name input.
When we press 'Enter' in the First Name input, we use lastNameRef.current.focus(); to set focus on the Last Name input.

Codepen Demo

https://codepen.io/deniapps/pen/wvGaaPV