Skip to content

Commit 68f0ec1

Browse files
committed
Merge branch 'develop' of github.com:GetStream/stream-chat-react-native into develop
2 parents af301d1 + b9e904b commit 68f0ec1

File tree

67 files changed

+169
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+169
-15
lines changed

.prettierignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
**/dist/
44
**/.expo/
55
**/vendor/
6-
*.md
7-
*.mdx
86
package/src/components/docs/
9-
package/lib/
10-
docusaurus/
7+
package/lib/

package/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
"@typescript-eslint/ban-ts-comment": 0,
149149
"@typescript-eslint/no-unused-vars": 1,
150150
"@typescript-eslint/no-var-requires": 0,
151-
"react-hooks/exhaustive-deps": 0,
151+
"react-hooks/exhaustive-deps": 1,
152152
"react-native/no-inline-styles": 0,
153153
"array-callback-return": 2,
154154
"arrow-body-style": 2,

package/src/components/Attachment/AudioAttachment.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
155155
soundRef.current.unloadAsync();
156156
}
157157
};
158+
// eslint-disable-next-line react-hooks/exhaustive-deps
158159
}, []);
159160

160161
// This is needed for expo applications where the rerender doesn't occur on time thefore you need to update the state of the sound.

package/src/components/Attachment/Gallery.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ const GalleryWithContext = <
141141
images: imagesAndVideos,
142142
sizeConfig,
143143
}),
144+
// eslint-disable-next-line react-hooks/exhaustive-deps
144145
[imagesAndVideosValue],
145146
);
146147

package/src/components/AttachmentPicker/AttachmentPicker.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export const AttachmentPicker = React.forwardRef(
137137
}
138138
setLoadingPhotos(false);
139139
}
140+
// eslint-disable-next-line react-hooks/exhaustive-deps
140141
}, [currentIndex, selectedPicker, loadingPhotos]);
141142

142143
// we need to use ref here to avoid running effect when getMorePhotos changes
@@ -172,6 +173,7 @@ export const AttachmentPicker = React.forwardRef(
172173
const backHandler = BackHandler.addEventListener('hardwareBackPress', backAction);
173174

174175
return () => backHandler.remove();
176+
// eslint-disable-next-line react-hooks/exhaustive-deps
175177
}, [selectedPicker, closePicker]);
176178

177179
useEffect(() => {
@@ -196,6 +198,7 @@ export const AttachmentPicker = React.forwardRef(
196198
Keyboard.removeListener(keyboardShowEvent, onKeyboardOpenHandler);
197199
}
198200
};
201+
// eslint-disable-next-line react-hooks/exhaustive-deps
199202
}, [closePicker, selectedPicker]);
200203

201204
useEffect(() => {
@@ -208,6 +211,7 @@ export const AttachmentPicker = React.forwardRef(
208211
setPhotoError(false);
209212
}
210213
}
214+
// eslint-disable-next-line react-hooks/exhaustive-deps
211215
}, [currentIndex, loadingPhotos]);
212216

213217
useEffect(() => {

package/src/components/AutoCompleteInput/AutoCompleteInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ const AutoCompleteInputWithContext = <
129129

130130
useEffect(() => {
131131
handleChange(text, true);
132+
// eslint-disable-next-line react-hooks/exhaustive-deps
132133
}, [text]);
133134

134135
const startTracking = (trigger: Trigger) => {

package/src/components/AutoCompleteInput/AutoCompleteSuggestionList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export const AutoCompleteSuggestionListWithContext = <
9595
return triggerType === 'emoji' || triggerType === 'command'
9696
? totalItemHeight + AUTO_COMPLETE_SUGGESTION_LIST_HEADER_HEIGHT
9797
: totalItemHeight;
98+
// eslint-disable-next-line react-hooks/exhaustive-deps
9899
}, [itemHeight, data.length]);
99100

100101
const renderItem = ({ item }: { item: Suggestion<StreamChatGenerics> }) => {

package/src/components/Channel/Channel.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ const ChannelWithContext = <
677677
loadMoreFinished.cancel();
678678
loadMoreThreadFinished.cancel();
679679
};
680+
// eslint-disable-next-line react-hooks/exhaustive-deps
680681
}, [channelId, messageId]);
681682

682683
const threadPropsExists = !!threadProps;
@@ -690,6 +691,7 @@ const ChannelWithContext = <
690691
} else {
691692
setThread(null);
692693
}
694+
// eslint-disable-next-line react-hooks/exhaustive-deps
693695
}, [threadPropsExists, shouldSyncChannel]);
694696

695697
const handleAppBackground = useCallback(() => {
@@ -702,6 +704,7 @@ const ChannelWithContext = <
702704
type: 'typing.stop',
703705
} as StreamEvent<StreamChatGenerics>);
704706
}
707+
// eslint-disable-next-line react-hooks/exhaustive-deps
705708
}, [thread?.id, channelId]);
706709

707710
useAppStateListener(undefined, handleAppBackground);
@@ -806,6 +809,7 @@ const ChannelWithContext = <
806809
return () => {
807810
channelSubscriptions.forEach((s) => s.unsubscribe());
808811
};
812+
// eslint-disable-next-line react-hooks/exhaustive-deps
809813
}, [channelId, shouldSyncChannel]);
810814

811815
// subscribe to the generic all channel event
@@ -843,6 +847,7 @@ const ChannelWithContext = <
843847
};
844848
const { unsubscribe } = channel.on(handleEvent);
845849
return unsubscribe;
850+
// eslint-disable-next-line react-hooks/exhaustive-deps
846851
}, [channelId, thread?.id, shouldSyncChannel]);
847852

848853
// subscribe to channel.deleted event
@@ -854,6 +859,7 @@ const ChannelWithContext = <
854859
});
855860

856861
return unsubscribe;
862+
// eslint-disable-next-line react-hooks/exhaustive-deps
857863
}, [channelId]);
858864

859865
useEffect(() => {
@@ -863,6 +869,7 @@ const ChannelWithContext = <
863869

864870
const { unsubscribe } = client.on('notification.mark_read', handleEvent);
865871
return unsubscribe;
872+
// eslint-disable-next-line react-hooks/exhaustive-deps
866873
}, []);
867874

868875
const channelQueryCallRef = useRef(
@@ -1058,6 +1065,7 @@ const ChannelWithContext = <
10581065
// now restart it since its done
10591066
restartSetsMergeFuncRef.current();
10601067
}
1068+
// eslint-disable-next-line react-hooks/exhaustive-deps
10611069
}, [targetedMessage]);
10621070

10631071
/**
@@ -1361,6 +1369,7 @@ const ChannelWithContext = <
13611369
return () => {
13621370
connectionChangedSubscription.unsubscribe();
13631371
};
1372+
// eslint-disable-next-line react-hooks/exhaustive-deps
13641373
}, [enableOfflineSupport, shouldSyncChannel]);
13651374

13661375
const reloadChannel = () =>
@@ -1825,6 +1834,7 @@ const ChannelWithContext = <
18251834
* Where the deps are [channelId, hasMore, loadingMoreRecent, loadingMore]
18261835
* and only those deps should be used here because of that
18271836
*/
1837+
// eslint-disable-next-line react-hooks/exhaustive-deps
18281838
[channelId, hasMore, loadingMore],
18291839
);
18301840

@@ -1896,6 +1906,7 @@ const ChannelWithContext = <
18961906
* Where the deps are [channelId, hasMore, loadingMoreRecent, loadingMore, hasNoMoreRecentMessagesToLoad]
18971907
* and and only those deps should be used here because of that
18981908
*/
1909+
// eslint-disable-next-line react-hooks/exhaustive-deps
18991910
[channelId, hasNoMoreRecentMessagesToLoad],
19001911
);
19011912

@@ -2086,6 +2097,7 @@ const ChannelWithContext = <
20862097
setThread(message);
20872098
setThreadMessages(newThreadMessages);
20882099
},
2100+
// eslint-disable-next-line react-hooks/exhaustive-deps
20892101
[setThread, setThreadMessages],
20902102
);
20912103

package/src/components/Channel/hooks/useCreateChannelContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const useCreateChannelContext = <
8484
watcherCount,
8585
watchers,
8686
}),
87+
// eslint-disable-next-line react-hooks/exhaustive-deps
8788
[
8889
channelId,
8990
disabled,

package/src/components/Channel/hooks/useCreateInputMessageInputContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export const useCreateInputMessageInputContext = <
133133
StartAudioRecordingButton,
134134
UploadProgressIndicator,
135135
}),
136+
// eslint-disable-next-line react-hooks/exhaustive-deps
136137
[compressImageQuality, channelId, editingDep, initialValue, maxMessageLength, quotedMessageId],
137138
);
138139

0 commit comments

Comments
 (0)