@react-navigation/elements 2.1.2 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/lib/commonjs/Header/HeaderBackButton.js +3 -4
  2. package/lib/commonjs/Header/HeaderBackButton.js.map +1 -1
  3. package/lib/commonjs/Header/HeaderIcon.js +2 -3
  4. package/lib/commonjs/Header/HeaderIcon.js.map +1 -1
  5. package/lib/commonjs/Header/HeaderSearchBar.js +5 -5
  6. package/lib/commonjs/Header/HeaderSearchBar.js.map +1 -1
  7. package/lib/commonjs/PlatformPressable.js +2 -1
  8. package/lib/commonjs/PlatformPressable.js.map +1 -1
  9. package/lib/module/Header/HeaderBackButton.js +3 -4
  10. package/lib/module/Header/HeaderBackButton.js.map +1 -1
  11. package/lib/module/Header/HeaderIcon.js +2 -3
  12. package/lib/module/Header/HeaderIcon.js.map +1 -1
  13. package/lib/module/Header/HeaderSearchBar.js +5 -5
  14. package/lib/module/Header/HeaderSearchBar.js.map +1 -1
  15. package/lib/module/PlatformPressable.js +2 -1
  16. package/lib/module/PlatformPressable.js.map +1 -1
  17. package/lib/typescript/commonjs/src/Header/HeaderIcon.d.ts.map +1 -1
  18. package/lib/typescript/commonjs/src/Header/HeaderSearchBar.d.ts.map +1 -1
  19. package/lib/typescript/commonjs/src/PlatformPressable.d.ts.map +1 -1
  20. package/lib/typescript/commonjs/tsconfig.build.tsbuildinfo +1 -1
  21. package/lib/typescript/module/src/Header/HeaderIcon.d.ts.map +1 -1
  22. package/lib/typescript/module/src/Header/HeaderSearchBar.d.ts.map +1 -1
  23. package/lib/typescript/module/src/PlatformPressable.d.ts.map +1 -1
  24. package/lib/typescript/module/tsconfig.build.tsbuildinfo +1 -1
  25. package/package.json +4 -4
  26. package/src/Header/HeaderBackButton.tsx +2 -2
  27. package/src/Header/HeaderIcon.tsx +2 -6
  28. package/src/Header/HeaderSearchBar.tsx +6 -3
  29. package/src/PlatformPressable.tsx +3 -1
@@ -34,6 +34,8 @@ const INPUT_TYPE_TO_MODE = {
34
34
  email: 'email',
35
35
  } as const;
36
36
 
37
+ const useNativeDriver = Platform.OS !== 'web';
38
+
37
39
  function HeaderSearchBarInternal(
38
40
  {
39
41
  visible,
@@ -70,7 +72,7 @@ function HeaderSearchBarInternal(
70
72
  Animated.timing(visibleAnim, {
71
73
  toValue: visible ? 1 : 0,
72
74
  duration: 100,
73
- useNativeDriver: true,
75
+ useNativeDriver,
74
76
  }).start(({ finished }) => {
75
77
  if (finished) {
76
78
  setRendered(visible);
@@ -93,7 +95,7 @@ function HeaderSearchBarInternal(
93
95
  Animated.timing(clearVisibleAnim, {
94
96
  toValue: hasText ? 1 : 0,
95
97
  duration: 100,
96
- useNativeDriver: true,
98
+ useNativeDriver,
97
99
  }).start(({ finished }) => {
98
100
  if (finished) {
99
101
  clearVisibleValueRef.current = hasText;
@@ -196,7 +198,8 @@ function HeaderSearchBarInternal(
196
198
  <Image
197
199
  source={clearIcon}
198
200
  resizeMode="contain"
199
- style={[styles.clearIcon, { tintColor: colors.text }]}
201
+ tintColor={colors.text}
202
+ style={styles.clearIcon}
200
203
  />
201
204
  </PlatformPressable>
202
205
  ) : null}
@@ -32,6 +32,8 @@ const ANDROID_VERSION_LOLLIPOP = 21;
32
32
  const ANDROID_SUPPORTS_RIPPLE =
33
33
  Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;
34
34
 
35
+ const useNativeDriver = Platform.OS !== 'web';
36
+
35
37
  /**
36
38
  * PlatformPressable provides an abstraction on top of Pressable to handle platform differences.
37
39
  */
@@ -60,7 +62,7 @@ export function PlatformPressable({
60
62
  toValue,
61
63
  duration,
62
64
  easing: Easing.inOut(Easing.quad),
63
- useNativeDriver: true,
65
+ useNativeDriver,
64
66
  }).start();
65
67
  };
66
68