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',
  ]);
  ...
 }
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,857評(píng)論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,135評(píng)論 0 23
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa閱讀 9,056評(píng)論 0 6
  • 你還年輕,你還有足夠的時(shí)間去發(fā)現(xiàn)世界的美好。
    蝸牛不二風(fēng)閱讀 143評(píng)論 0 0
  • 停不下這支筆,不知道這是一支什么樣的筆,它跳動(dòng)的每一個(gè)字符都戳弄著我的心,很痛、很痛! 不知道從何時(shí)開始我有了這支...
    星思閱讀 250評(píng)論 0 0

友情鏈接更多精彩內(nèi)容