5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

React Native (Expo) で黄色いワーニングを非表示にしたい (v0.63以降)

Posted at

console.disableYellowBox = trueは非推奨になった

調べるとよく出てくるのはconsole.disableYellowBox = trueですが、

TypeScriptにUse LogBox.ignoreAllLogs(disable) insteadと怒られます。

v0.63からLogBoxがデフォルトで導入

公式サイトをみるとデバッグ機能が強化されたLogBoxがデフォルトで導入されたようです。

Announcing React Native 0.63 with LogBox

LogBox.ignoreAllLogs()を代わりに使う

App.tsx
import { LogBox } from 'react-native';

LogBox.ignoreAllLogs()

これで怒られずにワーニングが非表示に出来るようになります。
開発中は鬱陶しい時も多いので上手く使いましょう。

5
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?