primitives icon indicating copy to clipboard operation
primitives copied to clipboard

fix: [@radix-ui/react-tooltip] tooltip performance issue

Open tangye1234 opened this issue 1 year ago • 1 comments

Description

The main purpose of this pr is to resolve the performance issue of tooltip provider.

When there are lots of tooltips inside tooltip provider, everytime tooltip open state is changing, all of the tooltips will re-render regardless of its relation to the iteraction.

I found that provider only provides some context settings and also help to maintain some lifecycle states, while tooltip itself is enough to control its own open state. So I think it is unneccessary for the provider's states to be broadcasted to all context consumers.

tangye1234 avatar Feb 23 '24 03:02 tangye1234