Answers for "how to ignore warnings in react native"

3

disable yellow box react native

console.disableYellowBox = true;
Posted by: Guest on May-06-2020
0

react native ignore warnings

UPDATE RN V0.63 ABOVE
YellowBox is now changed and replace with LogBox

FUNCTIONAL

import React, { useEffect } from 'react';
import { LogBox } from 'react-native';

useEffect(() => {
    LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}, [])

CLASS BASED

import React from 'react';
import { LogBox } from 'react-native';

componentDidMount() {
    LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
}




UPDATE RN V0.63 BELOW
FUNCTIONAL

import React, { useEffect } from 'react';
import { YellowBox } from 'react-native';

useEffect(() => {
    YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}, [])

CLASS BASED

import React from 'react';
import { YellowBox } from 'react-native';

componentDidMount() {
    YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
}
Posted by: Guest on March-10-2021
0

hide warnings in expo app

console.disableYellowBox = true;
// add this is main component of react native application
Posted by: Guest on July-26-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language