diff --git a/src/fragments/lib/datastore/native_common/setup-env.mdx b/src/fragments/lib/datastore/native_common/setup-env.mdx index 83921a1bfd6..a24affa71b8 100644 --- a/src/fragments/lib/datastore/native_common/setup-env.mdx +++ b/src/fragments/lib/datastore/native_common/setup-env.mdx @@ -27,3 +27,7 @@ Instead of using the platform integration, you can alternatively use the Amplify import all0 from '/src/fragments/lib/datastore/native_common/setup-env-cli.mdx'; + +import reactnative1 from '/src/fragments/lib/datastore/react-native/getting-started/polyfills.mdx'; + + diff --git a/src/fragments/lib/datastore/react-native/getting-started/30_platformIntegration.mdx b/src/fragments/lib/datastore/react-native/getting-started/30_platformIntegration.mdx index b667945b3dd..ddba0f01c88 100644 --- a/src/fragments/lib/datastore/react-native/getting-started/30_platformIntegration.mdx +++ b/src/fragments/lib/datastore/react-native/getting-started/30_platformIntegration.mdx @@ -12,7 +12,7 @@ Start with the [React Native CLI](https://reactnative.dev/docs/getting-started): npx react-native@0.68.2 init AmplifyDataStoreRN --version 0.68.2 cd AmplifyDataStoreRN npx amplify-app@latest -npm install aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage +npm install aws-amplify @react-native-community/netinfo @react-native-async-storage/async-storage core-js ``` 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 npx react-native@0.68.2 init AmplifyDataStoreRN --version 0.68.2 cd AmplifyDataStoreRN npx amplify-app@latest -npm install aws-amplify @aws-amplify/datastore-storage-adapter react-native-sqlite-storage @react-native-community/netinfo @react-native-async-storage/async-storage +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 npx pod-install ``` diff --git a/src/fragments/lib/datastore/react-native/getting-started/polyfills.mdx b/src/fragments/lib/datastore/react-native/getting-started/polyfills.mdx new file mode 100644 index 00000000000..f1d5e4aaf24 --- /dev/null +++ b/src/fragments/lib/datastore/react-native/getting-started/polyfills.mdx @@ -0,0 +1,7 @@ +### Add Required Polyfills + +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: + +```js +import 'core-js/full/symbol/async-iterator'; +```