-
Notifications
You must be signed in to change notification settings - Fork 0
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 默认props的设置与生命周期函数 #19
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
默认props的设置
react 中组件使用
state
中的值的时候,允许设置其默认值。这里没设置 name 的值所以调用的是默认值,如果设置了则会使用设置的值
生命周期函数
props
和state
渲染函数fiber 版本之前
fiber 版本之后
组件更新有两类情况:
1.父组件重新 render
2.使用 setState
参考文章
详解React生命周期
The text was updated successfully, but these errors were encountered: