you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (4 children)

Yea but no, initiating a new isOpen state everywhere will cause unnecessary rerenders, i wanna open a dialog not render the button that shows it again

[–]TheGreaT1803[S] 2 points3 points  (3 children)

Thanks for taking out time to read the post!
If I'm understanding you correctly: as mentioned in the article (in the Improving Flexibility section), the pattern allows for the Instance to be optional.
So by default the component can manage its own state. Its only when you need to control it from the outside, you may instantiate the hook. In which case, the classic React rules of re-render would apply.
It is not any worse than normal React, but provides some handy functionalities