react-native-gesture-handler 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,17 +3,21 @@ import ReactNative from 'react-native';
3
3
 
4
4
  import createNativeWrapper from './createNativeWrapper';
5
5
 
6
- const MEMOIZED = {};
6
+ const MEMOIZED = new WeakMap();
7
7
 
8
8
  function memoizeWrap(Component, config) {
9
- const memoized = MEMOIZED[Component.displayName];
10
- if (memoized) {
11
- return memoized;
9
+ if (Component == null) {
10
+ return null;
12
11
  }
13
- return (MEMOIZED[Component.displayName] = createNativeWrapper(
14
- Component,
15
- config
16
- ));
12
+ let memoized = MEMOIZED.get(Component);
13
+ if (!memoized) {
14
+ memoized = createNativeWrapper(
15
+ Component,
16
+ config
17
+ );
18
+ MEMOIZED.set(Component, memoized);
19
+ }
20
+ return memoized;
17
21
  }
18
22
 
19
23
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-gesture-handler",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Experimental implementation of a new declarative API for gesture handling in react-native",
5
5
  "scripts": {
6
6
  "start": "node node_modules/react-native/local-cli/cli.js start",