about summary refs log tree commit diff
path: root/src/state/shell/minimal-mode.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-06-06 14:17:26 +0100
committerGitHub <noreply@github.com>2024-06-06 14:17:26 +0100
commit48796449eae4be825041d4d372e9f64f61529429 (patch)
tree72aac7aea49117024f6a7f1239935cc52f936079 /src/state/shell/minimal-mode.tsx
parent1f954c106562bd79385248a3d1c119f5cbe48a9a (diff)
downloadvoidsky-48796449eae4be825041d4d372e9f64f61529429.tar.zst
Switch to withSpring to work around Reanimated regression (#4391)
Diffstat (limited to 'src/state/shell/minimal-mode.tsx')
-rw-r--r--src/state/shell/minimal-mode.tsx12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/state/shell/minimal-mode.tsx b/src/state/shell/minimal-mode.tsx
index 2c2f60b52..05999db85 100644
--- a/src/state/shell/minimal-mode.tsx
+++ b/src/state/shell/minimal-mode.tsx
@@ -1,10 +1,5 @@
 import React from 'react'
-import {
-  Easing,
-  SharedValue,
-  useSharedValue,
-  withTiming,
-} from 'react-native-reanimated'
+import {SharedValue, useSharedValue, withSpring} from 'react-native-reanimated'
 
 type StateContext = SharedValue<number>
 type SetContext = (v: boolean) => void
@@ -22,9 +17,8 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
   const setMode = React.useCallback(
     (v: boolean) => {
       'worklet'
-      mode.value = withTiming(v ? 1 : 0, {
-        duration: 400,
-        easing: Easing.bezier(0.25, 0.1, 0.25, 1),
+      mode.value = withSpring(v ? 1 : 0, {
+        overshootClamping: true,
       })
     },
     [mode],