React Native Component Lifecycle

What is the purpose of the getDerivedStateFromError method in React Native?