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.

Warning: AsyncStorage has been extracted from react-native core and will be removed in a future release.

Posted at

概要

AsyncStorage を利用しようと思い、

import { AsyncStorage } from 'react-native';

をしたらタイトルのWarningが出ました。
解決方法を書きます。

Warning

テキストがコピペできなかったのでキャプチャ。

スクリーンショット 2019-11-13 10.22.06.png

対応

丁寧にWarningに解決方法が書いてあるのでその通りに対応します。

% npm i @react-native-community/async-storage

インストールして、

-import { AsyncStorage } from 'react-native';
+import AsyncStorage from '@react-native-community/async-storage';

importを書き換える。

まとめ

React NativeのAsyncStorageで出たWarningの解決方法について書きました。
警告文中に解決方法まで書いてあるのは親切で良いです。

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?