0
0

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 5 years have passed since last update.

React-NativeとReact-Navigationを併用すると、isMounted(...) is deprecatedの警告が表示される + 一時的解決法

Posted at

React-Navigationを使ってみようとしたら、標題の現象が発生したので、一時的な解決法

原因

警告自体はES6のClassでは使われていないisMountedを使用している時に表示するもの。

しかし、React-navigationで使われているクラスにはisMountedが使用されていない。
どうやら原因はReact-native側にあるみたいで、警告が発生するべきではない自体でも発生してしまっている。

次リリースの.56では解決されている模様。

一時的解決法

以下の記載をindex.jsまたはApp.jsに加えれば、この警告が表示されても、アプリの画面上では表示されないように出来る。
警告自体はConsole上に表示されたまま。

import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['Warning: isMounted(...) is deprecated']);

参考

React-Native Issue #18868

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?