Benk I
Benk I

Reputation: 199

How to suppress a specific warning in expo

I am getting below warning

AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage

enter image description here

How can I suppress it?

I have tried the below method(placed below lines in app.js) but none are working.

import { LogBox } from 'react-native'

LogBox.ignoreLogs(['Warning: AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from `@react-native-async-storage/async-storage` instead of `react-native`. See https://github.com/react-native-async-storage/async-storage'])
import { LogBox } from 'react-native'

LogBox.ignoreLogs(["Warning: AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage"])

Can anyone help me to suppress it?

Upvotes: 0

Views: 4013

Answers (3)

Juanma
Juanma

Reputation: 676

Add console.disableYellowBox = true; to your index.js file. Worked for me.

Upvotes: 0

Equan Ur Rehman
Equan Ur Rehman

Reputation: 269

import { LogBox } from 'react-native';
LogBox.ignoreLogs(['Asyncstorage: ...']); // Ignore log notification by message
LogBox.ignoreAllLogs(); //Ignore all log notifications

Upvotes: 3

Tadej Slemenšek
Tadej Slemenšek

Reputation: 112

Its a warning. Do not suppress it. I guess you are using Async storage from 'react-native' package. Instead install @react-native-async-storage/async-storage and use it from here.

Upvotes: -1

Related Questions