jd-opensource / jd-opensource/taro-ui
重新渲染导致 Noticebar 重新开始 Animation
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
**问题描述**
如果在一个组件中 存在 Noticebar , 那么如果当前组件状态存在修改, 那么 NoticeBar 就会因为这样的修改而被迫重新开始 Animation

```tsx
interface State {
current: number;
}
const fakeArr = Array(10).fill(0);
class Index extends Component<{}, State> {
constructor(props) {
super(props);
this.state = {
current: 0,
};
}
handleClick(value) {
this.setState({
current: value,
});
}
render() {
return (
门店新上产品,快去看看哪款合适你~
{fakeArr.map((_, index) => (
))}
);
}
}
export default Index;
```
**期望行为**
不论Tab如何切换, 不应该导致 Noticebar 重新渲染
**系统信息**
微信小程序中
"@tarojs/components": "3.2.13",
"@tarojs/react": "3.2.13",
"@tarojs/runtime": "3.2.13",
"@tarojs/taro": "3.2.13",
"taro-ui": "^3.0.0-alpha.10"
Contributor guide
Assessment
This issue has not been assessed yet.