React Native Warning

1、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.
Please update the following components:Navigator
2、Warning:componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.

Solution of Warning componentwillmount is Deprecated and will be Removed in the Next Major Version :

1. This warning message is a temporary message and will be removed soon with the new react native version but its very irritating so we can easily remove this error by using YellowBox component in our react native project. This component will handle all the warning messages shows inside the yellow box. So import YellowBox component in your project.
import React, { Component } from 'react';
import { YellowBox } from 'react-native';
2. Call its inbuilt warning ignore method inside constructor() of your default class.
constructor(props) {
   super(props);
   YellowBox.ignoreWarnings([
    'Warning: componentWillMount is deprecated',
    'Warning: componentWillReceiveProps is deprecated',
  ]);
  ...
 }

你可能感兴趣的:(React Native Warning)