Skip to content

Commit 9190dc0

Browse files
committed
prevent reactions render before width is available
1 parent 471c3c6 commit 9190dc0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/SampleApp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@react-navigation/native": "5.9.2",
2222
"@react-navigation/stack": "5.14.2",
2323
"@stream-io/flat-list-mvcp": "0.0.9",
24-
"patch-package": "^6.4.7",
24+
"patch-package": "6.4.7",
2525
"react": "16.13.1",
2626
"react-native": "0.63.4",
2727
"react-native-document-picker": "5.0.0",

src/components/Message/MessageSimple/ReactionList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ const ReactionListWithContext = <
190190
};
191191

192192
useEffect(() => {
193-
showReactions(hasSupportedReactions);
194-
}, [hasSupportedReactions]);
193+
showReactions(hasSupportedReactions && messageContentWidth !== 0);
194+
}, [hasSupportedReactions, messageContentWidth]);
195195

196196
const animatedStyle = useAnimatedStyle<ViewStyle>(
197197
() => ({
@@ -200,7 +200,7 @@ const ReactionListWithContext = <
200200
[],
201201
);
202202

203-
if (!hasSupportedReactions) {
203+
if (!hasSupportedReactions || messageContentWidth === 0) {
204204
return null;
205205
}
206206

0 commit comments

Comments
 (0)