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 Class 组件的缺点 #91

Open
nmsn opened this issue Aug 7, 2023 · 1 comment
Open

React Class 组件的缺点 #91

nmsn opened this issue Aug 7, 2023 · 1 comment
Labels

Comments

@nmsn
Copy link
Contributor

nmsn commented Aug 7, 2023

No description provided.

@nmsn nmsn added the React label Aug 7, 2023
@nmsn
Copy link
Contributor Author

nmsn commented Aug 7, 2023

  1. constructor 和 super 每个组件都需要重复书写(比较冗余)
  2. 奇怪的 this 指向,需要 bind.this 来绑定(通过箭头函数解决)
  3. 繁琐的生命周期

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

No branches or pull requests

1 participant