Migrate runOnUI/runOnJS to scheduleOnUI/scheduleOnRN (#11249)
This commit is contained in:
@@ -4,13 +4,13 @@ import Animated, {
|
||||
type AnimatedRef,
|
||||
Extrapolation,
|
||||
interpolate,
|
||||
runOnJS,
|
||||
type SharedValue,
|
||||
useAnimatedProps,
|
||||
useAnimatedReaction,
|
||||
useAnimatedStyle,
|
||||
} from 'react-native-reanimated'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import {scheduleOnRN} from 'react-native-worklets'
|
||||
import {BlurView} from 'expo-blur'
|
||||
import {useIsFetching} from '@tanstack/react-query'
|
||||
|
||||
@@ -226,7 +226,7 @@ function useShouldAnimateSpinner({
|
||||
() => scrollY.get() < -5,
|
||||
(value, prevValue) => {
|
||||
if (value !== prevValue) {
|
||||
runOnJS(setIsOverscrolled)(value)
|
||||
scheduleOnRN(setIsOverscrolled, value)
|
||||
}
|
||||
},
|
||||
[scrollY],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import {memo, useMemo, useState} from 'react'
|
||||
import {type LayoutChangeEvent, StyleSheet, View} from 'react-native'
|
||||
import Animated, {
|
||||
runOnJS,
|
||||
useAnimatedReaction,
|
||||
useAnimatedStyle,
|
||||
withTiming,
|
||||
} from 'react-native-reanimated'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import {scheduleOnRN} from 'react-native-worklets'
|
||||
import {
|
||||
type AppBskyActorDefs,
|
||||
type AppBskyLabelerDefs,
|
||||
@@ -151,7 +151,7 @@ const MinimalHeader = memo(function MinimalHeader({
|
||||
() => scrollY.get() > 100,
|
||||
(value, prev) => {
|
||||
if (prev !== value) {
|
||||
runOnJS(setVisible)(value)
|
||||
scheduleOnRN(setVisible, value)
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user