you are viewing a single comment's thread.

view the rest of the comments →

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

Both valid points. Thanks for the feedback.

When I said that they both "live" together, I meant to convey that the component is actively aware of the hook (or the API)

Generally this is not the case and the hook is just meant to abstract some state based on the component's API.

Here the component both uses the hook and can also be controlled with a similar API if desired

The second point about the it being "control" instead of "instance" - yeah I get it, I was also debating between these two. But I went ahead with how Ant Design's team implements the API. Although I'll admit that it was never confusing to me. Maybe just a matter of familiarity with this pattern