|
|
|
|
|
by flowerlad
2161 days ago
|
|
For one thing you may not use the ref attribute on function components because they don’t have instances. That means the component can't have a .focus() method for example. For simple components hooks may be fine. For more complex ones I prefer classes. |
|
https://reactjs.org/docs/hooks-reference.html#useref
The example even uses .focus()