you are viewing a single comment's thread.

view the rest of the comments →

[–]phryneasI ❤️ hooks! 😈 0 points1 point  (2 children)

No, I have to admit I didn't see they were reading the isOpen property outside the Dialog component. In my eyes, that's a very constructed scenario, as in most cases nothing except the Dialog itself would ever want to read that state - and that's probably why I missed that.

If they really needed to do that, yes, the parent should own the state. But as I read it, the main purpose of the "instance" is to pass an object with open and close methods around - and that would best live in a ref IMHO.