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

我希望在深入 React 之前知道这些 #2

Open
justjavac opened this issue Nov 1, 2017 · 4 comments
Open

我希望在深入 React 之前知道这些 #2

justjavac opened this issue Nov 1, 2017 · 4 comments

Comments

@justjavac
Copy link
Contributor

justjavac commented Nov 1, 2017

文章我希望在深入 React 之前知道这些

音频:无

视频:无


原文I wish I knew these before diving into React

@peterchealse
Copy link

会玩

@1gehunzi
Copy link

即使 props 没有改变,也会调用 componentWillReceiveProps,因此需要在函数内部比较 this.props 和 nextProps
这句话是什么意思不太理解您要表达什么

@justjavac
Copy link
Contributor Author

这句话解释为什么要比较 this.propsnextProps,因为即使 props 没有改变,也会调用 componentWillReceiveProps,而 componentWillReceiveProps 默认总是返回 true

@1gehunzi
Copy link

理解了 之前没注意过这个细节。 即使没有显性声明的 props 也会调用componentWillReceiveProps。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants