React Lifecycle Methods
Mounting Lifecycle Methods
Called once on initial render
Method | current props and state | prevProps | prevState | nextProps | nextState | Can call this.setState |
Called when? | Used for |
---|---|---|---|---|---|---|---|---|
constructor |
no | no | no | no | no | no | once, just before static getDerivedStateFromProps() is called for the first time |
setting initial state |