Skip to content

Commit

Permalink
Remove unnecessary useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
JCQuintas committed Aug 28, 2024
1 parent 551209b commit 4c23244
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/x-charts/src/internals/useAnimatedPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ function usePrevious<T>(value: T) {
currentPath: value,
previousPath: undefined,
});
React.useEffect(() => {
if (ref.current.currentPath !== value) {
ref.current = {
currentPath: value,
previousPath: ref.current.currentPath,
};
}, [value]);
}

return ref.current;
}

Expand Down

0 comments on commit 4c23244

Please sign in to comment.