1 min readApr 10, 2018
--
The reason getDerivedStateFromProps is static is to discourage any side-effects during the render phase. For example, updating or using props on the instance.
This isn’t safe anymore with the upcoming async rendering.
It is called when a component is created and each time it recieves a new props.
More info on the react blog: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#fetching-external-data-when-props-change