1console.disableYellowBox = true;
2//add it anywhere in any page to disable warnings in emulator
1// for RN >= 0.63
2// in your entry file (eg. App.tsx)
3
4import { LogBox } from 'react-native';
5// ignore warnings that start in a string that matchs any of
6// the ones in the array
7LogBox.ignoreLogs(["Require cycle:"])
1UPDATE RN V0.63 ABOVE
2YellowBox is now changed and replace with LogBox
3
4FUNCTIONAL
5
6import React, { useEffect } from 'react';
7import { LogBox } from 'react-native';
8
9useEffect(() => {
10 LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
11}, [])
12
13CLASS BASED
14
15import React from 'react';
16import { LogBox } from 'react-native';
17
18componentDidMount() {
19 LogBox.ignoreLogs(['VirtualizedLists should never be nested']);
20}
21
22
23
24
25UPDATE RN V0.63 BELOW
26FUNCTIONAL
27
28import React, { useEffect } from 'react';
29import { YellowBox } from 'react-native';
30
31useEffect(() => {
32 YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
33}, [])
34
35CLASS BASED
36
37import React from 'react';
38import { YellowBox } from 'react-native';
39
40componentDidMount() {
41 YellowBox.ignoreWarnings(['VirtualizedLists should never be nested']);
42}