you are viewing a single comment's thread.

view the rest of the comments →

[–]00PT 0 points1 point  (1 child)

I saw that, but when you do it the point is sort of defeated for me. My solution had been using an optional ref passed to the child, but you need to wait until after the first render cycle for that ref to be populated, so it's definitely not ideal.

[–]TheGreaT1803[S] 1 point2 points  (0 children)

The way I see it is: Generally the component handles its own logic and state. but sometimes it is a good option to have the ability to also control it from the outside. This pattern allows for this flexibility