From 853da85d4176b83737e2bfd2a8c2fd9c90faa8a2 Mon Sep 17 00:00:00 2001 From: Jorrin Date: Thu, 7 Mar 2024 23:40:40 +0100 Subject: [PATCH] Add setup steps to React native --- .docs/content/2.essentials/0.usage-on-x.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.docs/content/2.essentials/0.usage-on-x.md b/.docs/content/2.essentials/0.usage-on-x.md index 0c7443d..da53dc1 100644 --- a/.docs/content/2.essentials/0.usage-on-x.md +++ b/.docs/content/2.essentials/0.usage-on-x.md @@ -39,6 +39,23 @@ const providers = makeProviders({ ``` ## React native +To use the library in a react native app, you would also need a couple of polyfills to polyfill crypto and base64. + +1. First install the polyfills: +```bash +npm install @react-native-anywhere/polyfill-base64 react-native-quick-crypto +``` + +2. Add the polyfills to your app: +```ts +// Import in your entry file +import '@react-native-anywhere/polyfill-base64'; +``` + +And follow the [react-native-quick-crypto documentation](https://github.com/margelo/react-native-quick-crypto) to set up the crypto polyfill. + +3. Then you can use the library like this: + ```ts import { makeProviders, makeStandardFetcher, targets } from '@movie-web/providers';