Skip to content

Commit

Permalink
test(statistic): update test
Browse files Browse the repository at this point in the history
  • Loading branch information
HaixingOoO committed Nov 15, 2023
1 parent 3b77b11 commit 110077e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/statistic/Statistic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ const Statistic = forwardRef<StatisticRef, StatisticProps>((props, ref) => {
}, []);

useEffect(() => {
if (animationStart && animation && !tween.current) {
start();
}
animationStart && animation && !tween.current && start();

return () => {
if (tween.current) {
tween.current.stop();
Expand All @@ -135,9 +134,9 @@ const Statistic = forwardRef<StatisticRef, StatisticProps>((props, ref) => {
tween.current = null;
}
setInnerValue(value);
if (animationStart && animation) {
start();
}

animationStart && animation && start();

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [value]);

Expand Down
6 changes: 3 additions & 3 deletions src/statistic/_example/combination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { IconFont } from 'tdesign-icons-react';
const CombinationStatistic = () => {
const iconStyle = {
fontSize: '32px',
color: '#0052d9',
background: '#f2f3ffff',
borderRadius: '6px',
color: 'var(--td-brand-color)',
background: 'var(--td-brand-color-light)',
borderRadius: 'var(--td-radius-medium)',
padding: '12px',
};
const separator = <Divider layout="vertical" style={{ height: '100%' }} />;
Expand Down

0 comments on commit 110077e

Please sign in to comment.