Skip to content

Commit

Permalink
Merge pull request #45314 from Expensify/yuwen-sliderDependency
Browse files Browse the repository at this point in the history
Make Slider Transformation Function Callback a worklet

(cherry picked from commit 951e3fe)
  • Loading branch information
Julesssss authored and OSBotify committed Jul 15, 2024
1 parent a813a63 commit b65231d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/AvatarCropModal/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ function Slider({sliderValue, gestureCallbacks}: SliderProps) {

// A reanimated memoized style, which tracks
// a translateX shared value and updates the slider position.
const rSliderStyle = useAnimatedStyle(() => ({
transform: [{translateX: sliderValue.value}],
}));
const rSliderStyle = useAnimatedStyle(() => {
'worklet';

return {
transform: [{translateX: sliderValue.value}],
};
});

const panGesture = Gesture.Pan()
.minDistance(5)
Expand Down

0 comments on commit b65231d

Please sign in to comment.