I have something like this:
<App>
<CommentForm/>
<CommentList/>
</App>
<App> has shared states for <CommentForm/> and <CommentList/>.
<CommentForm/> has form and after comment is submitted it appears in <CommentList>.
It all works fine expect that I cannot find good way of triggering focus() event on textarea in <CommentForm>.
I know that I can do it by creating ref, but as I known it is not really a good practice.
Is there a way to trigger focus event using state in React?
Btw, I am not interested in autoFocus.
onFocusSynthetic event in react. here is link to react [docs]: [reactjs.org/docs/events.html#focus-events]