react-native-toast-message 2.1.1 → 2.1.2

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.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,12 @@ Headers are one of:
9
9
 
10
10
  - `Added`, `Changed`, `Removed`, `Fixed` or `Breaking`.
11
11
 
12
+ ## [2.1.2]
13
+
14
+ ### Fixed
15
+
16
+ - Fixes `useNativeDriver` warning on web by [jpaas](https://github.com/jpaas) in [#334](https://github.com/calintamas/react-native-toast-message/pull/334)
17
+
12
18
  ## [2.1.1]
13
19
 
14
20
  ### Fixed
package/README.md CHANGED
@@ -33,9 +33,3 @@ Animated toast message component for React Native.
33
33
  ## License
34
34
 
35
35
  MIT
36
-
37
- ## Support
38
-
39
- Not a requirement in any way, but if this package helped you (or your company) and you feel like supporting my future work:
40
-
41
- <a href="https://buymeacoffee.com/calintamas"><img src="https://user-images.githubusercontent.com/9104454/143683074-69dc6a53-3e54-4a2c-8dcf-c1e27448a2f4.png" alt="Buy me a coffee" width="150px" /></a>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Animated } from 'react-native';
2
+ import { Animated, Platform } from 'react-native';
3
3
  import { additiveInverseArray } from '../utils/array';
4
4
  import { useKeyboard } from './useKeyboard';
5
5
  export function translateYOutputRangeFor({ position, height, topOffset, bottomOffset, keyboardHeight, keyboardOffset }) {
@@ -9,13 +9,14 @@ export function translateYOutputRangeFor({ position, height, topOffset, bottomOf
9
9
  const outputRange = position === 'bottom' ? additiveInverseArray(range) : range;
10
10
  return outputRange;
11
11
  }
12
+ const useNativeDriver = Platform.select({ native: true, default: false });
12
13
  export function useSlideAnimation({ position, height, topOffset, bottomOffset, keyboardOffset }) {
13
14
  const animatedValue = React.useRef(new Animated.Value(0));
14
15
  const { keyboardHeight } = useKeyboard();
15
16
  const animate = React.useCallback((toValue) => {
16
17
  Animated.spring(animatedValue.current, {
17
18
  toValue,
18
- useNativeDriver: true,
19
+ useNativeDriver,
19
20
  friction: 8
20
21
  }).start();
21
22
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-toast-message",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Toast message component for React Native",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -31,15 +31,15 @@
31
31
  "@babel/core": "^7.15.8",
32
32
  "@testing-library/jest-native": "^4.0.4",
33
33
  "@testing-library/react-hooks": "^7.0.2",
34
- "@testing-library/react-native": "^8.0.0",
34
+ "@testing-library/react-native": "^9.0.0",
35
35
  "@types/jest": "^27.0.1",
36
36
  "@types/react-native": "^0.66.2",
37
- "eslint-config-backpacker-react-ts": "^0.2.0",
37
+ "eslint-config-backpacker-react-ts": "^0.3.0",
38
38
  "husky": "^7.0.2",
39
39
  "import-sort-style-module": "^6.0.0",
40
40
  "jest": "^27.1.1",
41
41
  "lint-staged": "^12.1.2",
42
- "metro-react-native-babel-preset": "^0.66.2",
42
+ "metro-react-native-babel-preset": "^0.67.0",
43
43
  "prettier": "^2.4.1",
44
44
  "prettier-plugin-import-sort": "^0.0.7",
45
45
  "react-test-renderer": "^17.0.2",