Skip to content

Commit 0399512

Browse files
committed
docs(expo): add documentation on extra setup for Expo web
1 parent aaa0d5c commit 0399512

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

docs/docs/basics/installation.mdx

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ iOS requires a few extra steps that are _not_ required for Android/Web.
4848

4949
### Enable Swift Modules
5050

51-
Because the iOS module uses Swift, if the user is using a standard react-native application they'll need to add support for Swift in the project. This can be easily by adding a swift file to the Xcode project -- could be called `dummy.swift` and saying yes when prompted if you'd like to generate a bridging header.
51+
Because the iOS module uses Swift, if the user is using a standard react-native
52+
application they'll need to add support for Swift in the project. This can be
53+
easily by adding a swift file to the Xcode project -- could be called
54+
`dummy.swift` and saying yes when prompted if you'd like to generate a bridging
55+
header.
5256

5357
![Importing Swift](https://i.imgur.com/CBqBcWs.png)
5458

@@ -95,13 +99,45 @@ if you're using HLS streams with MPEG2-TS content.
9599
</TabItem>
96100
</Tabs>
97101

102+
## Expo Web
103+
104+
Expo web [does not currently support dynamic imports](https://github.com/doublesymmetry/react-native-track-player/pull/2299#issuecomment-2462566794)
105+
which are leveraged in the web package to support SSR. If you'd like to use the
106+
web version via Expo the recommendation is to:
107+
108+
### 1. Install `@expo/metro-runtime`
109+
110+
<Tabs groupId="pkg">
111+
<TabItem value="npm" label="NPM" default>
112+
113+
npm install --save @expo/metro-runtime
114+
115+
</TabItem>
116+
<TabItem value="yarn" label="Yarn">
117+
118+
yarn add @expo/metro-runtime
119+
120+
</TabItem>
121+
</Tabs>
122+
123+
### 2. Import `@expo/metro-runtime` in your App root
124+
125+
```tsx
126+
// App.tsx
127+
import '@expo/metro-runtime';
128+
...
129+
```
130+
98131
## Expo
99132

100-
You can now use React Native Track Player with Expo.
133+
You can now use React Native Track Player with Expo.
101134

102-
Please be aware that while many people are using React Native Track Player with Expo successfully, the current maintainers of this project do not use Expo and their ability to resolve issues involving Expo is limited.
135+
Please be aware that while many people are using React Native Track Player with
136+
Expo successfully, the current maintainers of this project do not use Expo and
137+
their ability to resolve issues involving Expo is limited.
103138

104-
To get started, create a [custom development client](https://docs.expo.dev/clients/getting-started/) for your Expo app and then install React Native Track Player.
139+
To get started, create a [custom development client](https://docs.expo.dev/clients/getting-started/)
140+
for your Expo app and then install React Native Track Player.
105141

106142
Here is the configuration required for audio playback in background:
107143

0 commit comments

Comments
 (0)