Skip to content

Commit

Permalink
fix: adjust native driver value based on the rn version
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak committed Dec 27, 2023
1 parent 92a0a80 commit 78dea56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
StyleSheet,
StyleProp,
TextStyle,
Platform,
} from 'react-native';
import color from 'color';

Expand Down Expand Up @@ -160,7 +161,7 @@ const Button = ({
Animated.timing(elevation, {
toValue: 8,
duration: 200 * scale,
useNativeDriver: true,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
}).start();
}
};
Expand All @@ -171,7 +172,7 @@ const Button = ({
Animated.timing(elevation, {
toValue: 2,
duration: 150 * scale,
useNativeDriver: true,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
}).start();
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const Chip = ({
Animated.timing(elevation, {
toValue: 4,
duration: 200 * scale,
useNativeDriver: true,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
}).start();
};

Expand All @@ -161,7 +161,7 @@ const Chip = ({
Animated.timing(elevation, {
toValue: 0,
duration: 150 * scale,
useNativeDriver: true,
useNativeDriver: Platform.constants.reactNativeVersion.minor <= 72,
}).start();
};

Expand Down

0 comments on commit 78dea56

Please sign in to comment.