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 文档建议在 componentDidMount 中发起 ajax 请求? #2

Open
forl opened this issue Dec 15, 2018 · 0 comments
Open

Comments

@forl
Copy link
Owner

forl commented Dec 15, 2018

React 的官方文档中建议在 componentDidMount 中执行有副作用的操作,比如发起 ajax 请求,相信很多人读到过这一建议,并且在日常工作中也是这样遵循的。但是问什么会有这样的建议呢?React 项目中有这样一个 issue,讨论的就是这一建议背后的原因:

reactjs/react.dev#302

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

No branches or pull requests

1 participant