Skip to content

Commit 4fafe9a

Browse files
docs: added optional dependencies docs for Expo
1 parent ea1a189 commit 4fafe9a

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

docusaurus/docs/reactnative/basics/getting_started.mdx

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,67 @@ But an awesome tool named [jetifier](https://github.com/mikehardy/jetifier) is q
180180

181181
## Expo Installation
182182

183-
Stream Chat for React Native is set up for parity on Expo, expo requires a different set of dependencies than bare React Native, in your project directory run:
183+
Stream Chat for React Native is set up for parity on Expo, expo requires a different set of dependencies than bare React Native, in your project directory run.
184+
185+
### Add Required Dependencies
184186

185187
```bash
186188
expo install stream-chat-expo
187189
expo install @react-native-community/netinfo expo-document-picker expo-file-system expo-haptics expo-image-manipulator expo-image-picker expo-media-library expo-sharing react-native-gesture-handler react-native-reanimated react-native-safe-area-context react-native-svg expo-av
188190
```
191+
192+
### Additional Steps
193+
194+
For some of the packages listed below, there are additional steps required to setup the package:
195+
196+
- `react-native-reanimated` - [additional installation steps](https://docs.expo.dev/versions/latest/sdk/reanimated/#installation)
197+
198+
Add Reanimated's babel plugin to your babel.config.js:
199+
200+
```js
201+
module.exports = {
202+
...
203+
plugins: [
204+
...
205+
'react-native-reanimated/plugin',
206+
],
207+
};
208+
```
209+
210+
- `react-native-gesture-handler` - [additional installation steps](https://docs.expo.dev/versions/latest/sdk/gesture-handler/#api)
211+
212+
RNGH requires the package to be imported at the **top of the entry file** before anything else, this is usually your `App.js` or `index.js` file.
213+
214+
```tsx
215+
import 'react-native-gesture-handler';
216+
import { AppRegistry } from 'react-native';
217+
218+
import App from './App';
219+
import { name as appName } from './app.json';
220+
221+
AppRegistry.registerComponent(appName, () => App);
222+
```
223+
224+
Also wrap your entry point with `<GestureHandlerRootView>` or `gestureHandlerRootHO`
225+
226+
```jsx
227+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
228+
import { OverlayProvider } from 'stream-chat-react-native';
229+
230+
export default function App() {
231+
return (
232+
<GestureHandlerRootView>
233+
<OverlayProvider>{/* Your app code goes here */}</OverlayProvider>
234+
</GestureHandlerRootView>
235+
);
236+
}
237+
```
238+
239+
### Add Optional Dependencies
240+
241+
- `expo-av` - [additional installation steps](https://docs.expo.dev/versions/v45.0.0/sdk/video/)
242+
243+
> Available in stream-chat-expo >= v4.7.0
244+
245+
Installing this package allows you to play the video files/attachments in the chat. Otherwise by default, video files will be opened in default
246+
browser of the device.

0 commit comments

Comments
 (0)