[charts] Fix LineChart transition stopping before completion#14366
Conversation
|
Deploy preview: https://deploy-preview-14366--material-ui-x.netlify.app/ |
CodSpeed Performance ReportMerging #14366 will not alter performanceComparing Summary
|
alexfauquette
left a comment
There was a problem hiding this comment.
Looks nice, but it still causes issues when adding/removing a line to the chart
Capture.video.du.2024-08-27.18-07-00.mp4
https://deploy-preview-14366--material-ui-x.netlify.app/x/react-charts/lines/#animation
| function usePrevious<T>(value: T) { | ||
| const ref = React.useRef<T | null>(null); | ||
| const ref = React.useRef<{ current: T; previous?: T }>({ | ||
| current: value, |
There was a problem hiding this comment.
Maybe renaming it with actual or currentValue to avoid the confusion with the current of the ref
We were using |
|
These two seem to be unrelated though: #14355 |
Janpot
left a comment
There was a problem hiding this comment.
👍 Verified that it fixes #12873
https://codesandbox.io/p/sandbox/exciting-wright-m4s345?file=%2Fpackage.json%3A6%2C82
alexfauquette
left a comment
There was a problem hiding this comment.
Happy to see this fixed 🎉
I don't see any issue 👍
Fixes #12873
Closes #12892
Fixes original issue: https://codesandbox.io/p/sandbox/solitary-cookies-2k447w?file=%2Fsrc%2FDemo.tsx%3A7%2C1&workspaceId=836800c1-9711-491c-a89b-3ac24cbd8cd8
And example issue opened on react-spring
https://stackblitz.com/edit/vitejs-vite-9sj21g?file=src%2FApp.tsx