title: React-native lifecycle methods warning: " componentWillReceiveProps is deprecated and will be removed in the next major version"
body: <p>While using the life-cycle methods in react-native, I have encountered the following warning messages in the console as well as in the emulator:</p>
  
  <blockquote>
    <p>Warning: componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.</p>
    
    <p>Warning: componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount.</p>
  </blockquote>
  
  <p>The warnings are even displayed annoyingly in the emulator as follows: 
  <a href="https://i.stack.imgur.com/QKNZG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QKNZG.png" alt="Warning messages in the Emulator"></a></p>
  
  <p>The problem arises whenever i dismiss the warning messages in the emulator, the application crashes, hence i have to restart the application again.
  What can I do about this?</p>
  
  <p>Also, despite the warning messages, I have never used the method "componentWillReceiveProps". However, I have made use of the method "componentWillMount". What could be the cause of receiving warning message even related to method "componentWillReceiveProps"?</p>