What is the purpose of the getDerivedStateFromProps method in React Native?
The getDerivedStateFromProps method in React Native is called before every render, both on the initial mount and on subsequent updates. It allows you to synchronize state with props when props change, by returning an object to update the state.