Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(location) : 修复多次render导致tab栏下划线动画不流畅的问题 #260

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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