Skip to content

docs: Update docs to reflect organization change #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion website/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions website/docs/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
14 changes: 7 additions & 7 deletions website/docs/Linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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`
Expand All @@ -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`.

Expand All @@ -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')
}
```

Expand Down Expand Up @@ -86,7 +86,7 @@ protected List<ReactPackage> 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.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions website/docs/advanced/Jest-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions website/docs/help/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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 <React/RCTBridgeModule.h>
^~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down