Hacker News new | ask | show | jobs
by hombre_fatal 721 days ago
It's more general to spawn a portal per component because then you can show multiple popovers at a time, like popovers that are always visible or only go away if you click "Close". So it makes sense to start there for the naive solution.
2 comments

Yeah I suspect it was probably for this reason, but to answer the parent comment, yes it was required in the sense that it's simply how the Ant Design popover component works (or at least that's how it worked in 2021 which is when I did this).
Right but the dots aren't popovers. The dots trigger popovers. You should have one dot per dot and one popover per popover.

You could certainly make a popover per dot in any react library. It would just be bad to do so.