Skip to content

Commit 243350b

Browse files
committed
fix: ensure back compatibility with web
1 parent 6b829b2 commit 243350b

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎src/components/Button.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ const Button = ({
161161
Animated.timing(elevation, {
162162
toValue: 8,
163163
duration: 200 * scale,
164-
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
164+
useNativeDriver:
165+
Platform.OS === 'web' ||
166+
Platform.constants.reactNativeVersion.minor <= 72,
165167
}).start();
166168
}
167169
};
@@ -172,7 +174,9 @@ const Button = ({
172174
Animated.timing(elevation, {
173175
toValue: 2,
174176
duration: 150 * scale,
175-
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
177+
useNativeDriver:
178+
Platform.OS === 'web' ||
179+
Platform.constants.reactNativeVersion.minor <= 72,
176180
}).start();
177181
}
178182
};

‎src/components/Card/Card.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ const Card = ({
166166
Animated.timing(elevation, {
167167
toValue: isPressTypeIn ? 8 : cardElevation,
168168
duration: animationDuration,
169-
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
169+
useNativeDriver:
170+
Platform.OS === 'web' ||
171+
Platform.constants.reactNativeVersion.minor <= 72,
170172
}).start();
171173
}
172174
};

‎src/components/Chip.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ const Chip = ({
152152
Animated.timing(elevation, {
153153
toValue: 4,
154154
duration: 200 * scale,
155-
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
155+
useNativeDriver:
156+
Platform.OS === 'web' ||
157+
Platform.constants.reactNativeVersion.minor <= 72,
156158
}).start();
157159
};
158160

@@ -161,7 +163,9 @@ const Chip = ({
161163
Animated.timing(elevation, {
162164
toValue: 0,
163165
duration: 150 * scale,
164-
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
166+
useNativeDriver:
167+
Platform.OS === 'web' ||
168+
Platform.constants.reactNativeVersion.minor <= 72,
165169
}).start();
166170
};
167171

0 commit comments

Comments
 (0)