Improve chat performance (#6157)

* fix worklet funcs on gestures

* don't access .value in render
This commit is contained in:
Samuel Newman
2024-11-08 03:38:32 +00:00
committed by GitHub
parent 22dd4947f7
commit 468c4b8f5a
3 changed files with 8 additions and 9 deletions
+1 -3
View File
@@ -127,9 +127,7 @@ function Inner() {
setHasScrolled={setHasScrolled}
/>
) : (
<>
<View style={[a.align_center, a.gap_sm, a.flex_1]} />
</>
<View style={[a.align_center, a.gap_sm, a.flex_1]} />
)}
{!readyToShow && (
<View
@@ -202,9 +202,9 @@ export function MessagesList({
convoState.items.length,
// these are stable
flatListRef,
isAtTop.value,
isAtBottom.value,
layoutHeight.value,
isAtTop,
isAtBottom,
layoutHeight,
],
)
@@ -212,7 +212,7 @@ export function MessagesList({
if (hasScrolled && prevContentHeight.current > layoutHeight.value) {
convoState.fetchMessageHistory()
}
}, [convoState, hasScrolled, layoutHeight.value])
}, [convoState, hasScrolled, layoutHeight])
const onScroll = React.useCallback(
(e: ReanimatedScrollEvent) => {
@@ -374,7 +374,7 @@ export function MessagesList({
},
[
flatListRef,
keyboardIsOpening.value,
keyboardIsOpening,
layoutScrollWithoutAnimation,
layoutHeight,
],