If I have a component like
const Comp = ({children}) => {
//some code
return (
<div>
{children}
</div>
)
}
and then call it like
<Comp>
<input onChange={...} />
<input onChange={...} />
</Comp>
How can I change the focus to the first input field of this component when the component renders, from within the Comp
component.
Ideally I would like to have a useEffect function or something which looks something like
useEffect(() => {
thisComponent.firstChild.focus()
})