Wednesday, March 6, 2019

How to hide warning message in React Native app?

Software Required
-NPM version 6.4.1
-expo version 2.6.14
-Atom 1.34.0

Problems
  • During my development, encounter error as shown below when try to test it on Expo client.
Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.



Steps
  • Add the line as shown below into your App.js
  •  console.disableYellowBox = true;  
    
  • It may not solve the root cause of the problem, it may temporary hide the uncomfortable warning message on your App. Meanwhile, it buy you time to look for solution if you need a quick release.
  •  
    ...
    render() {
        console.disableYellowBox = true;
        ...