Merge pull request #107 from movie-web/fix/improve-rn-docs

docs: Add setup steps to React native
This commit is contained in:
Jorrin 2024-03-07 23:46:31 +01:00 committed by GitHub
commit 2aa7585b79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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