Skip to content

Conversation

lovelyJason
Copy link

@lovelyJason lovelyJason commented Apr 30, 2020

if (activeTab ) {

}
...

componentDidUpdate() {
componentDidUpdate(this);
}

======>
// 多添加个判断条件,重复的activeKey不设置动画
if (activeTab && (!prevProps || activeKey !== prevProps.activeKey)) {

}
...

componentDidUpdate(prevProps) {
// resolve the probleme that when our component render many times ,inkTabBarNode's animation is not smoothly.
componentDidUpdate(this, false, prevProps);
}

if (activeTab ) {
...

  componentDidUpdate() {
    // resolve the probleme that when our component render many times ,inkTabBarNode's animation is not smoothly.
    componentDidUpdate(this, false, prevProps);
  }

======>

if (activeTab && (!prevProps || activeKey !== prevProps.activeKey)) {
...

  componentDidUpdate() {
    componentDidUpdate(this);
  }
@vercel
Copy link

vercel bot commented Apr 30, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/tabs/2zj7bhkdt
✅ Preview: https://tabs-git-fork-lovelyjason-fix-activetab.react-component.now.sh

if (activeTab ) {

}
...

componentDidUpdate() {
	componentDidUpdate(this);
}

======>
// 多添加个判断条件,重复的activeKey不设置动画
if (activeTab && (!prevProps || activeKey !== prevProps.activeKey)) {

}
...

componentDidUpdate(prevProps) {
	// resolve the probleme that when our component render many times ,inkTabBarNode's animation is not smoothly.
	componentDidUpdate(this, false, prevProps);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant