Add setup steps to React native

This commit is contained in:
Jorrin 2024-03-07 23:40:40 +01:00
parent 89ae529dd1
commit 853da85d41
1 changed files with 17 additions and 0 deletions

View File

@ -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';