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',
  ]);
  ...
 }
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,211评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,628评论 0 23
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 12,889评论 0 6
  • 你还年轻,你还有足够的时间去发现世界的美好。
    蜗牛不二风阅读 1,166评论 0 0
  • 停不下这支笔,不知道这是一支什么样的笔,它跳动的每一个字符都戳弄着我的心,很痛、很痛! 不知道从何时开始我有了这支...
    星思阅读 1,612评论 0 0

友情链接更多精彩内容