We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
getScrollContainer不应该有默认函数,只要定义了该函数,就不需要额外渲染一个ScrollContainer了
如果用户返回一个ref,这个ref只会在ComponentDidMount时才不为undefined,导致进入了需要渲染ScrollContainer的分支,ref取到后,又进入了不需要渲染ScrollContainer的分支,这时children就被多创建了一次。
情景:
引发了我这边一个数据问题,数据不对了;
我这边的一些操作可能在children第一次被创建时就走过了,然后走了些异步逻辑,回来发现相关引用都变成新的了,由于二次创建又走了相关的周期覆盖了最开始的引用。这时多个异步流程链里,前面的拿的是第一次的引用,后面的拿的是第二次的引用,从而引发了一些潜在的bug
临时解法:
getScrollContainer={() => this.scrollViewRef || {}}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
getScrollContainer不应该有默认函数,只要定义了该函数,就不需要额外渲染一个ScrollContainer了
如果用户返回一个ref,这个ref只会在ComponentDidMount时才不为undefined,导致进入了需要渲染ScrollContainer的分支,ref取到后,又进入了不需要渲染ScrollContainer的分支,这时children就被多创建了一次。
情景:
引发了我这边一个数据问题,数据不对了;
我这边的一些操作可能在children第一次被创建时就走过了,然后走了些异步逻辑,回来发现相关引用都变成新的了,由于二次创建又走了相关的周期覆盖了最开始的引用。这时多个异步流程链里,前面的拿的是第一次的引用,后面的拿的是第二次的引用,从而引发了一些潜在的bug
临时解法:
The text was updated successfully, but these errors were encountered: