about summary refs log tree commit diff
path: root/src/screens/Messages/components/MessageInput.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-11-17 15:06:28 +0000
committerGitHub <noreply@github.com>2024-11-17 15:06:28 +0000
commit474c4eff29b6a2454a20febf78a1edd5cf58663a (patch)
tree43a189a8101cf3f5265d967ad46182cf8cbde9a0 /src/screens/Messages/components/MessageInput.tsx
parentd575a2fdaaa4d9c93d6b739dfe3377cdd5985dc1 (diff)
downloadvoidsky-474c4eff29b6a2454a20febf78a1edd5cf58663a.tar.zst
Use compiler-safe Reanimated get/set APIs (#6391)
* Convert lightbox to get/set

* Work around software-mansion/react-native-reanimated#6613

* Use get/set in more places

* Port MainScrollProvider to get/set

* Port more to get/set

* Port composer to get/set

* Remove unnecessary thread hops in composer

* Port more things to get/set

* Convert more to get/set, remove redundant runOnJS

* Convert remaining cases to get/set
Diffstat (limited to 'src/screens/Messages/components/MessageInput.tsx')
-rw-r--r--src/screens/Messages/components/MessageInput.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/screens/Messages/components/MessageInput.tsx b/src/screens/Messages/components/MessageInput.tsx
index 8edad6272..85509211b 100644
--- a/src/screens/Messages/components/MessageInput.tsx
+++ b/src/screens/Messages/components/MessageInput.tsx
@@ -108,22 +108,22 @@ export function MessageInput({
         const measurement = measure(inputRef)
         if (!measurement) return
 
-        const max = windowHeight - -keyboardHeight.value - topInset - 150
+        const max = windowHeight - -keyboardHeight.get() - topInset - 150
         const availableSpace = max - measurement.height
 
-        maxHeight.value = max
-        isInputScrollable.value = availableSpace < 30
+        maxHeight.set(max)
+        isInputScrollable.set(availableSpace < 30)
       },
     },
     [windowHeight, topInset],
   )
 
   const animatedStyle = useAnimatedStyle(() => ({
-    maxHeight: maxHeight.value,
+    maxHeight: maxHeight.get(),
   }))
 
   const animatedProps = useAnimatedProps(() => ({
-    scrollEnabled: isInputScrollable.value,
+    scrollEnabled: isInputScrollable.get(),
   }))
 
   return (