From b5a842f70a12863021570e3e756fc3be4b7055df Mon Sep 17 00:00:00 2001 From: COURTES Guillaume <guillaumecourtes88@gmail.com> Date: Mon, 1 Feb 2021 14:20:11 +0100 Subject: [PATCH] fix asyncStorage warning : using @react-native-async-storage/async-storage --- .../components/AuthenticateNavigation.js | 3 ++- react-native/ChatApp/components/ListScreen.js | 2 +- .../ChatApp/components/MessagesScreen.js | 2 +- react-native/ChatApp/package-lock.json | 21 +++++++++++++++++++ react-native/ChatApp/package.json | 1 + 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/react-native/ChatApp/components/AuthenticateNavigation.js b/react-native/ChatApp/components/AuthenticateNavigation.js index 914ffa74e..67d201b6d 100644 --- a/react-native/ChatApp/components/AuthenticateNavigation.js +++ b/react-native/ChatApp/components/AuthenticateNavigation.js @@ -2,7 +2,8 @@ import React from 'react'; import { NavigationContainer } from '@react-navigation/native'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'; -import { AsyncStorage, ActivityIndicator, View } from 'react-native'; +import { ActivityIndicator, View } from 'react-native'; +import AsyncStorage from '@react-native-async-storage/async-storage'; import HomeScreen from './HomeScreen' import DiscussionsScreen from './DiscussionsScreen' diff --git a/react-native/ChatApp/components/ListScreen.js b/react-native/ChatApp/components/ListScreen.js index 3f4089442..d7e7ff01e 100644 --- a/react-native/ChatApp/components/ListScreen.js +++ b/react-native/ChatApp/components/ListScreen.js @@ -4,7 +4,7 @@ import { FlatList } from 'react-native'; import { ListItem, Icon } from 'react-native-elements'; -import { AsyncStorage } from 'react-native'; +import AsyncStorage from '@react-native-async-storage/async-storage'; class ListScreen extends React.Component { diff --git a/react-native/ChatApp/components/MessagesScreen.js b/react-native/ChatApp/components/MessagesScreen.js index c5d801264..683c8fa78 100644 --- a/react-native/ChatApp/components/MessagesScreen.js +++ b/react-native/ChatApp/components/MessagesScreen.js @@ -1,7 +1,7 @@ import React from 'react'; import { View, Text, StyleSheet, ActivityIndicator } from 'react-native'; import { GiftedChat, utils, Bubble } from 'react-native-gifted-chat'; -import { AsyncStorage } from 'react-native'; +import AsyncStorage from '@react-native-async-storage/async-storage'; const { isSameUser, isSameDay } = utils diff --git a/react-native/ChatApp/package-lock.json b/react-native/ChatApp/package-lock.json index 7d7b1b7dd..fd492981d 100644 --- a/react-native/ChatApp/package-lock.json +++ b/react-native/ChatApp/package-lock.json @@ -1232,6 +1232,14 @@ } } }, + "@react-native-async-storage/async-storage": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.13.4.tgz", + "integrity": "sha512-P7cbA77XNhUFEBKAIaex17mKI/Db1RQHZVwplagskqzEnpqB+Yi+/l8QeOMr5OJdfmPkBA+V7DOmuWeB8Po6cQ==", + "requires": { + "deep-assign": "^3.0.0" + } + }, "@react-native-community/cli-debugger-ui": { "version": "4.13.1", "resolved": "https://registry.npmjs.org/@react-native-community/cli-debugger-ui/-/cli-debugger-ui-4.13.1.tgz", @@ -3016,6 +3024,14 @@ "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, + "deep-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/deep-assign/-/deep-assign-3.0.0.tgz", + "integrity": "sha512-YX2i9XjJ7h5q/aQ/IM9PEwEnDqETAIYbggmdDB3HLTlSgo1CxPsj6pvhPG68rq6SVE0+p+6Ywsm5fTYNrYtBWw==", + "requires": { + "is-obj": "^1.0.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -4696,6 +4712,11 @@ "kind-of": "^3.0.2" } }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", diff --git a/react-native/ChatApp/package.json b/react-native/ChatApp/package.json index 0a2193bdc..9593289a5 100644 --- a/react-native/ChatApp/package.json +++ b/react-native/ChatApp/package.json @@ -10,6 +10,7 @@ "lint": "eslint ." }, "dependencies": { + "@react-native-async-storage/async-storage": "^1.13.4", "@react-native-community/masked-view": "^0.1.10", "@react-navigation/bottom-tabs": "^5.11.2", "@react-navigation/material-bottom-tabs": "^5.3.10", -- GitLab