@@ -5,13 +5,13 @@ import {useSharedValue, useAnimatedStyle, runOnJS, useAnimatedReaction, withTimi
5
5
import { forwardRef , ForwardRefInjectedProps , Constants } from '../../commons/new' ;
6
6
import { extractAccessibilityProps } from '../../commons/modifiers' ;
7
7
import { Colors , Spacings } from '../../style' ;
8
+ import { StyleUtils } from 'utils' ;
8
9
import View from '../../components/view' ;
9
10
import { SliderProps } from '../../components/slider' ;
10
11
import {
11
12
validateValues ,
12
13
getOffsetForValue ,
13
14
getValueForOffset ,
14
- unpackStyle ,
15
15
getStepInterpolated
16
16
} from './SliderPresenter' ;
17
17
import Thumb from './Thumb' ;
@@ -99,12 +99,12 @@ const Slider = React.memo((props: Props) => {
99
99
const defaultThumbStyle : StyleProp < ViewStyle > = useMemo ( ( ) => [
100
100
styles . thumb , { backgroundColor : disabled ? Colors . $backgroundDisabled : thumbTintColor }
101
101
] , [ disabled , thumbTintColor ] ) ;
102
- const _thumbStyle = useSharedValue ( unpackStyle ( thumbStyle || defaultThumbStyle ) ) ;
103
- const _activeThumbStyle = useSharedValue ( unpackStyle ( activeThumbStyle ) ) ;
102
+ const _thumbStyle = useSharedValue ( StyleUtils . unpackStyle ( thumbStyle || defaultThumbStyle , { flatten : true } ) ) ;
103
+ const _activeThumbStyle = useSharedValue ( StyleUtils . unpackStyle ( activeThumbStyle , { flatten : true } ) ) ;
104
104
105
105
useEffect ( ( ) => {
106
106
if ( ! thumbStyle ) {
107
- _thumbStyle . value = unpackStyle ( defaultThumbStyle ) ;
107
+ _thumbStyle . value = StyleUtils . unpackStyle ( defaultThumbStyle , { flatten : true } ) ;
108
108
}
109
109
// eslint-disable-next-line react-hooks/exhaustive-deps
110
110
} , [ defaultThumbStyle , thumbStyle ] ) ;
0 commit comments