How can I hide yellow warning in expo-cli console? SDK 31.0.2

I’ve having the below warning in expo cli console

How can I hide those warning?
I’ve tried

console.disableYellowBox = true;

import {YellowBox} from 'react-native';
YellowBox.ignoreWarnings(['Warning: ReactNative.createElement']);

But those doesn’t seem to work.

Have you tried the following:

YellowBox.ignoreWarnings(['Require cycle']);

Otherwise, you can also fix the issue itself too. You only need to remove the import from components/Buttons/Button.js that calls something from components/index.js.

Your current implementation may be:

import { Component } from '..';

Instead, use a direct import:

import Component from '../Component/Component';

Thanks for the reply.
Yeah, I’m currently using like that but I want to import multiple components.

My current implementation is like this.


import { default as Button } from './Button';
import { default as FirstComponent } from './FirstComponent';
import { default as SecondComponent } from './SecondComponent';
import { default as ThirdComponent } from './ThirdComponent';

So that I can import these components like this.

import { Button, FirstComponent, SecondComponent } from 'components'

But in components/Button.js, if I import components/FirstComponent.js with above method the warning occurs.


// currently using like this to avoid warning
import FirstComponent from './FirstComponent';
import SecondComponent from './SecondComponent';
import ThirdComponent from './ThirdComponent';

// what i want to do is like this
import { FirstComponent, SecondComponent, ThirdComponent } from '../components';

This answer seems like off topic, but I want to know whether I can disable yellow warning in console or not.

I understand, but what you’re trying to do is what this warning is warning you about…

Have you tried this?

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.