-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use ResizeObserver to listen to size changes #360
Conversation
The previous approach used a `requestAnimationFrame()` loop with calls to `getBoundingClientRect()` on every frame. Fixes TanStack#359
c536ba2
to
64e847b
Compare
Fantastic! Would you mind making this same change in react-charts? ;) |
The release is failing because of the dependency removal. It changed the output structure of the rollup files. npm run build locally and ensure the exports in package.json map to the correct output files. |
Thanks for merging so fast, awesome! 馃檶
Sure, I will give it a try, probably later today.
|
Created a PR for the build issue -> #361 |
Reduces idle CPU usage and should also improve scrolling performance. The previous approach used a
requestAnimationFrame()
loop with calls togetBoundingClientRect()
on every frame.Fixes #359
Before
After (+ dark mode 馃槃):
Verified it still works, the number of items increase and decrease when resizing:
Screen.Recording.2022-08-03.at.00.53.53.mov