Reaching Into A Component
Accessing a component from the parent. eg. Autofocus an input (controlled by parent component)
Child Component
An input component with a focus() method that focuses the HTML element
Parent Component
In the parent component, we can get a reference to the Input component and call its focus() method.
Reference:
Last updated
Was this helpful?