Improve chat performance (#6157)
* fix worklet funcs on gestures * don't access .value in render
This commit is contained in:
@@ -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,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user