diff --git a/website/docs/API.md b/website/docs/API.md index 6d65318e..68bf4013 100644 --- a/website/docs/API.md +++ b/website/docs/API.md @@ -543,7 +543,7 @@ You can replace your `App.js` with the following to see it in action. ```jsx import React, { useState, useEffect } from 'react'; import { View, Text, TouchableOpacity } from 'react-native'; -import { useAsyncStorage } from '@react-native-community/async-storage'; +import { useAsyncStorage } from '@react-native-async-storage/async-storage'; export default function App() { const [value, setValue] = useState('value'); diff --git a/website/docs/Installation.md b/website/docs/Installation.md index 7b3558e4..4c1d7218 100644 --- a/website/docs/Installation.md +++ b/website/docs/Installation.md @@ -9,7 +9,7 @@ sidebar_label: Installation ### Get library ```bash -yarn add @react-native-community/async-storage +yarn add @react-native-async-storage/async-storage ``` ### Link @@ -28,7 +28,7 @@ npx pod-install ```bash -react-native link @react-native-community/async-storage +react-native link @react-native-async-storage/async-storage ``` *Note:* For `Windows` the [manual linking](Linking.md) is currently the only linking option. diff --git a/website/docs/Linking.md b/website/docs/Linking.md index 43340f8e..3307aa84 100644 --- a/website/docs/Linking.md +++ b/website/docs/Linking.md @@ -13,7 +13,7 @@ sidebar_label: Manual linking 2. Right click on the Libraries folder and select `Add files to "yourProjectName"`. -3. Add `RNCAsyncStorage.xcodeproj` (located at `node_modules/@react-native-community/async-storage/ios`) to your project Libraries. +3. Add `RNCAsyncStorage.xcodeproj` (located at `node_modules/@react-native-async-storage/async-storage/ios`) to your project Libraries. 3. Go to `Build Phases -> Link Binary with Libraries` and add: `libRNCAsyncStorage.a`. @@ -23,7 +23,7 @@ sidebar_label: Manual linking 2. Add this line to your `Podfile` just below the last pod (if you don't have one, you can create it by running `pod init`): ```diff -+ pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' ++ pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-async-storage/async-storage' ``` 3. Run `pod install` @@ -35,7 +35,7 @@ sidebar_label: Manual linking 2. Right click on the Libraries folder and select `Add files to "yourProjectName"`. -3. Add `RNCAsyncStorage.xcodeproj` (located at `node_modules/@react-native-community/async-storage/macos`) to your project Libraries. +3. Add `RNCAsyncStorage.xcodeproj` (located at `node_modules/@react-native-async-storage/async-storage/macos`) to your project Libraries. 4. Go to `Build Phases -> Link Binary with Libraries` and add: `libRNCAsyncStorage-macOS.a`. @@ -47,15 +47,15 @@ rootProject.name = 'MyApp' include ':app' -+ include ':@react-native-community_async-storage' -+ project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android') ++ include ':@react-native-async-storage' ++ project(':@react-native-async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-async-storage/async-storage/android') ``` 2. In `android/app/build.gradle` add to dependencies: ```diff dependencies { ... -+ implementation project(':@react-native-community_async-storage') ++ implementation project(':@react-native-async-storage') } ``` @@ -86,7 +86,7 @@ protected List getPackages() { 1. Open your solution in Visual Studio. 2. Right click Solution icon in Solution Explorer > Add > Existing Project. - Select `node_modules\@react-native-community\async-storage\windows\ReactNativeAsyncStorage\ReactNativeAsyncStorage.vcxproj` + Select `node_modules\@react-native-async-storage\async-storage\windows\ReactNativeAsyncStorage\ReactNativeAsyncStorage.vcxproj` #### Add a reference to `ReactNativeAsyncStorage` in your main application project. diff --git a/website/docs/Usage.md b/website/docs/Usage.md index cea5396b..4fb9a4f4 100644 --- a/website/docs/Usage.md +++ b/website/docs/Usage.md @@ -12,7 +12,7 @@ For data that can be serialized to JSON you can use `JSON.stringify()` when savi ### Importing ```js -import AsyncStorage from '@react-native-community/async-storage'; +import AsyncStorage from '@react-native-async-storage/async-storage'; ``` ### Storing data diff --git a/website/docs/advanced/Jest-integration.md b/website/docs/advanced/Jest-integration.md index b055b381..5baf42d8 100644 --- a/website/docs/advanced/Jest-integration.md +++ b/website/docs/advanced/Jest-integration.md @@ -13,12 +13,12 @@ You can use one of two ways to provide mocked version of `AsyncStorage`: ### With __mocks__ directory -1. In your project root directory, create `__mocks__/@react-native-community` directory. +1. In your project root directory, create `__mocks__/@react-native-async-storage` directory. 2. Inside that folder, create `async-storage.js` file. 3. Inside that file, export `Async Storage` mock. ```javascript -export default from '@react-native-community/async-storage/jest/async-storage-mock' +export default from '@react-native-async-storage/async-storage/jest/async-storage-mock' ``` ### With Jest setup file @@ -34,9 +34,9 @@ export default from '@react-native-community/async-storage/jest/async-storage-mo 2. Inside your setup file, set up Async Storage mocking: ```javascript -import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock'; +import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock'; -jest.mock('@react-native-community/async-storage', () => mockAsyncStorage); +jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage); ``` ## Testing with mock @@ -56,7 +56,7 @@ You can override mock implementation, by replacing its inner functions: ```javascript // somewhere in your configuration files -import AsyncStorageMock from '@react-native-community/async-storage/jest/async-storage-mock'; +import AsyncStorageMock from '@react-native-async-storage/async-storage/jest/async-storage-mock'; AsyncStorageMock.multiGet = jest.fn(([keys], callback) => { // do something here to retrieve data diff --git a/website/docs/help/Troubleshooting.md b/website/docs/help/Troubleshooting.md index b03dfafa..bc19a85d 100644 --- a/website/docs/help/Troubleshooting.md +++ b/website/docs/help/Troubleshooting.md @@ -11,7 +11,7 @@ sidebar_label: Troubleshooting 3. If you're using CocoaPods: 1. Make sure your `Podfile` has this entry: ```Podfile - pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-community/async-storage' + pod 'RNCAsyncStorage', :path => '../node_modules/@react-native-async-storage/async-storage' ``` 2. Make sure your `Podfile` does _not_ have an entry for `react-native-async-storage`. 3. `pod install` @@ -20,15 +20,15 @@ sidebar_label: Troubleshooting 5. Press ⇧⌥⌘K to clean your build folder 6. Build and run your project -> Note that every time `@react-native-community/async-storage` gets updated, you +> Note that every time `@react-native-async-storage/async-storage` gets updated, you > must also run `pod update RNCAsyncStorage` otherwise you'll still be using the > previous version. ## [iOS] fatal error: 'React/RCTBridgeModule.h' file not found ``` -info In file included from /~/@react-native-community/async-storage/ios/RNCAsyncStorage.m:8: -/~/@react-native-community/async-storage/ios/RNCAsyncStorage.h:8:9: fatal error: 'React/RCTBridgeModule.h' file not found +info In file included from /~/@react-native-async-storage/async-storage/ios/RNCAsyncStorage.m:8: +/~/@react-native-async-storage/async-storage/ios/RNCAsyncStorage.h:8:9: fatal error: 'React/RCTBridgeModule.h' file not found info #import ^~~~~~~~~~~~~~~~~~~~~~~~~