Reference for React components defined as classes.
Mounting | Updating | Unmounting |
---|---|---|
constructor() | ||
static getDerivedStateFromProps() | ||
render() | ||
componentDidMount() | ||
static getDerivedStateFromProps() | ||
shouldComponentUpdate() | ||
render() | ||
getSnapshotBeforeUpdate() | ||
componentDidUpdate() | ||
componentWillUnmount() |
*** Executed in order from top to bottom
Methods called when instance of component added to the DOM
- constructor()
- static getDerivedStateFromProps()
- render()
- componentDidMount()
Legacy:
- UNSAFE_componentWillMount()
Methods called when component re-rendered (changes in props or state)
- static getDerivedStateFromProps()
- shouldComponentUpdate()
- render()
- getSnapshotBeforeUpdate()
- componentDidUpdate()
Legacy:
- UNSAFE_componentWillUpdate()
- UNSAFE_componentWillReceiveProps()
Methods called when component removed from DOM
- componentWillUnmount()
Methods called when an error ocurred during rendering, lifcicly method or child's constructor
- static getDerivedStateFromError()
- componentDidCatch()