React-08: state of the three core attributes of component instances
Others
2021-03-28 13:42:17
views: null
Accurately distinguish between simple components and complex components
- Simple component without state
- Complex components have state
Initialize state
- Modify in the constructor of the component class
- First pass the parameter props to the constructor, this parameter is automatically passed to us by React.
- Call super()
- Initialize state
- Here this refers to the instance object of the component
General shorthand for state
Origin blog.csdn.net/sinat_41696687/article/details/115049824