浏览代码

better support for static functions

Daniel Zlotin 7 年前
父节点
当前提交
6700be075f
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 1
    3
      lib/src/components/ComponentWrapper.tsx
  2. 1
    0
      package.json

+ 1
- 3
lib/src/components/ComponentWrapper.tsx 查看文件

81
     }
81
     }
82
 
82
 
83
     ReactLifecyclesCompat.polyfill(WrappedComponent);
83
     ReactLifecyclesCompat.polyfill(WrappedComponent);
84
-
85
-    _.defaults(WrappedComponent, OriginalComponentClass);
86
-
84
+    require('hoist-non-react-statics')(WrappedComponent, OriginalComponentClass);
87
     return WrappedComponent;
85
     return WrappedComponent;
88
   }
86
   }
89
 }
87
 }

+ 1
- 0
package.json 查看文件

56
     "lodash": "4.x.x",
56
     "lodash": "4.x.x",
57
     "prop-types": "15.x.x",
57
     "prop-types": "15.x.x",
58
     "react-lifecycles-compat": "2.0.0",
58
     "react-lifecycles-compat": "2.0.0",
59
+    "hoist-non-react-statics": "2.x.x",
59
     "@types/react": "16.x.x",
60
     "@types/react": "16.x.x",
60
     "@types/react-native": "0.51.1",
61
     "@types/react-native": "0.51.1",
61
     "@types/lodash": "4.x.x",
62
     "@types/lodash": "4.x.x",