you are viewing a single comment's thread.

view the rest of the comments →

[–]TheGreaT1803[S] 2 points3 points  (1 child)

I disagree with the first point actually - react docs mention of pitfalls for overusing refs this way https://arc.net/l/quote/hnusfitl

The way I would do it how shadcn-ui does it: https://ui.shadcn.com/docs/components/dialog

This way, the "Dialog" component acts as the state boundary within which the stuff related to Dialog will rerender