@@ -6,9 +6,11 @@ title: Upgrading from V4
66import Tabs from ' @theme/Tabs' ;
77import TabItem from ' @theme/TabItem' ;
88
9+ This guide highlights the changes introduced from v4 to v5.
10+
911## Prop or Context Changes
1012
11- Following values in [ ` ImageGalleryContext ` ] ( https://getstream.io/chat/docs/sdk/reactnative/v5/contexts/image-gallery-context/#value ) have been renamed
13+ The following values in [ ` ImageGalleryContext ` ] ( https://getstream.io/chat/docs/sdk/reactnative/v5/contexts/image-gallery-context/#value ) have been renamed:
1214
1315- ` image ` -> ` selectedMessage `
1416- ` setImage ` -> ` setSelectedMessage `
@@ -17,13 +19,13 @@ Following values in [`ImageGalleryContext`](https://getstream.io/chat/docs/sdk/r
1719
1820## Dependency Changes
1921
20- - If you have installed ` stream-chat ` dependency explicitly on your application, then upgrade it to v7
22+ - If you have installed ` stream-chat ` dependency explicitly in your application, then upgrade it to v7:
2123
2224 ``` bash
23252426 ```
2527
26- - Replace [ ` @react-native-community/cameraroll ` ] ( https://github.com/react-native-cameraroll/react-native-cameraroll ) dependency with [ ` @react-native-camera-roll/camera-roll ` ] ( https://www.npmjs.com/package/@react-native-camera-roll/camera-roll )
28+ - Replace [ ` @react-native-community/cameraroll ` ] ( https://github.com/react-native-cameraroll/react-native-cameraroll ) dependency with [ ` @react-native-camera-roll/camera-roll ` ] ( https://www.npmjs.com/package/@react-native-camera-roll/camera-roll ) :
2729
2830 ``` bash
2931 yarn remove @react-native-community/cameraroll
@@ -32,52 +34,52 @@ Following values in [`ImageGalleryContext`](https://getstream.io/chat/docs/sdk/r
3234
3335## Enable Offline Support
3436
35- Offline Support is a major opt-in feature introduced in v5 of SDK.
37+ Offline support is a major opt-in feature introduced in v5 of the Stream Chat React Native SDK.
3638
3739> Offline support is currently not implemented for Expo package (stream-chat-expo).
3840
39- Offline storage implementation currently offers following features:
41+ The offline storage implementation currently offers the following features:
4042
41- - access to chat when internet is disabled
42- - faster loading of chat since chat gets loaded from offline storage first before loading data from network
43- - syncing of database using websocket events and sync api .
43+ - Access to chat when Internet connection is disabled or low.
44+ - Faster startup times and loading, since initial data is loaded from offline storage before performing any network requests.
45+ - Syncing of the offline database using WebSocket events and Sync API .
4446
45- Following features are currently ** NOT** implemented. They will be implemented gradually as part of minor releases in v5.
47+ The following features are currently ** NOT** implemented. They will be implemented gradually as part of minor releases in v5.
4648
47- - optimistically update offline database during chat interactions such as send message, add reactions etc.
48- - access to threads in offline mode
49- - offline caching of attachment images and user images
49+ - Optimistically update offline database during chat interactions, such as send message, add reaction, etc.
50+ - Access to threads in offline mode.
51+ - Offline caching of attachment images and profile images.
5052
51- To enable offline support please follow the given steps:
53+ To enable offline support, please follow the given steps:
5254
53- - ** Upgrade stream-chat dependency (optional)**
55+ 1 . ** Upgrade stream-chat dependency (optional)**
5456
55- If you have installed ` stream-chat ` dependency explicitly on your application, then upgrade it to v7
57+ If you have installed ` stream-chat ` dependency explicitly on your application, then upgrade it to v7:
5658
5759 ``` bash
58605961 ```
6062
61- - ** Add ` react-native-quick-sqlite ` dependency**
63+ 2 . ** Add ` react-native-quick-sqlite ` dependency**
6264
6365 ``` bash
6466 yarn add react-native-quick-sqlite
6567 npx pod-install
6668 ```
6769
68- - ** Ensure unique instance of Chat component**
70+ 3 . ** Ensure a unique instance of Chat component**
6971
70- Until v4, you could provide separate ` Chat ` component for each usage of ` Channel ` component or ` ChannelList ` component.
71- But from v5, it is necessary that you provide only one instance of ` Chat ` component within your application.
72- This component needs to be a parent for all the chat related components such as ` ChannelList ` , ` Channel ` or ` Thread ` .
72+ Until v4, you could provide a separate ` Chat ` component for each usage of ` Channel ` component or ` ChannelList ` component.
73+ But from v5, you must provide only one instance of the ` Chat ` component within your application.
74+ This component needs to be a parent for all the chat- related components such as ` ChannelList ` , ` Channel ` or ` Thread ` .
7375
74- - ** Do not wait for ` connectUser ` call to succeed**
76+ 4 . ** Do not wait for ` connectUser ` call to succeed**
7577
76- It is important that you call ` connectUser ` method on chat client, before you render Chat components.
78+ It is important that you call the ` connectUser ` method on the chat client, before you render Chat components.
7779 But you don't need to wait for ` connectUser ` to succeed before rendering Chat components. This is to ensure:
7880
7981 - Chat components have access to current user information, which is important to store/access offline data.
80- - In case of slow or no network, Chat components will still load the chat data without waiting for connectUser to succeed.
82+ - In case of slow or no network access , Chat components will still load the chat data without waiting for ` connectUser ` to succeed.
8183
8284 ``` tsx {7,8,16}
8385 const chatClient = StreamChat .getInstance (' API_KEY' );
@@ -105,7 +107,7 @@ To enable offline support please follow the given steps:
105107 };
106108 ```
107109
108- - ** Add ` enableOfflineSupport ` prop on Chat component**
110+ 5 . ** Add ` enableOfflineSupport ` prop on Chat component**
109111
110112 ``` tsx
111113 import { Chat } from ' stream-chat-react-native' ;
@@ -115,11 +117,11 @@ To enable offline support please follow the given steps:
115117 </Chat >;
116118 ```
117119
118- - ** Reset the database when signing out the user**
120+ 6 . ** Reset the database when signing out the user**
119121
120- Since SDK doesn't handle the app level authentication logic, its application's responsibility
121- to ensure resetting database when user gets logged out. This should be generally done before you
122- call ` client.disconnectUser() `
122+ Since the SDK doesn't handle app- level authentication logic, it's the application's responsibility
123+ to ensure the database is reset when a user gets logged out. This should generally be done before you
124+ call ` client.disconnectUser() ` .
123125
124126 ``` jsx
125127 import { QuickSqliteClient } from ' stream-chat-react-native' ;
0 commit comments