Skip to content

Commit 3700fef

Browse files
Dane Pilchertimngyn
andauthored
add react native polyfill to getting started (#5097)
* add react native polyfill to getting started * move polyfill to only datastore getting started * fix typo Co-authored-by: Tim Nguyen <[email protected]> * add phrasing suggestions --------- Co-authored-by: Tim Nguyen <[email protected]>
1 parent d69fb7d commit 3700fef

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/fragments/lib/datastore/native_common/setup-env.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ Instead of using the platform integration, you can alternatively use the Amplify
2727
import all0 from '/src/fragments/lib/datastore/native_common/setup-env-cli.mdx';
2828

2929
<Fragments fragments={{ all: all0 }} />
30+
31+
import reactnative1 from '/src/fragments/lib/datastore/react-native/getting-started/polyfills.mdx';
32+
33+
<Fragments fragments={{ 'react-native': reactnative1 }} />

src/fragments/lib/datastore/react-native/getting-started/30_platformIntegration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Start with the [React Native CLI](https://reactnative.dev/docs/getting-started):
1212
npx [email protected] init AmplifyDataStoreRN --version 0.68.2
1313
cd AmplifyDataStoreRN
1414
npx amplify-app@latest
15-
npm install aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage
15+
npm install aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage core-js
1616
```
1717

1818
You will also need to install the pod dependencies for iOS:
@@ -31,7 +31,7 @@ To enable SQLite with DataStore for enhanced local database performance, follow
3131
npx [email protected] init AmplifyDataStoreRN --version 0.68.2
3232
cd AmplifyDataStoreRN
3333
npx amplify-app@latest
34-
npm install aws-amplify @aws-amplify/datastore-storage-adapter react-native-sqlite-storage @react-native-community/netinfo @react-native-async-storage/async-storage
34+
npm install aws-amplify @aws-amplify/datastore-storage-adapter react-native-sqlite-storage @react-native-community/netinfo @react-native-async-storage/async-storage core-js
3535
npx pod-install
3636
```
3737

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Add Required Polyfills
2+
3+
React Native is missing some JavaScript standard library functionality that DataStore depends on. Add the following to the entry point of your app to polyfill these missing functionalities:
4+
5+
```js
6+
import 'core-js/full/symbol/async-iterator';
7+
```

0 commit comments

Comments
 (0)