Permalink
Browse files

Fix createElement warnings

  • Loading branch information...
mridgway committed Jul 28, 2018
1 parent 69090b6 commit e0846feefbad8b34d300de9966ffd607aacb81a3
Showing with 16 additions and 3 deletions.
  1. +1 −0 package.json
  2. +2 −2 src/index.js
  3. +5 −0 tests/unit/index.js
  4. +8 −1 yarn.lock
@@ -47,6 +47,7 @@
"istanbul": "^0.4.5",
"mocha": "^3.4.2",
"pre-commit": "^1.0.7",
"prop-types": "^15.6.2",
"react": "^16.3.2",
"rimraf": "^2.6.2",
"rollup": "^0.52.3",
@@ -56,8 +56,8 @@ export default function hoistNonReactStatics(targetComponent, sourceComponent, b
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
const targetStatics = TYPE_STATICS[ReactIs.typeOf(React.createElement(targetComponent))] || REACT_STATICS;
const sourceStatics = TYPE_STATICS[ReactIs.typeOf(React.createElement(sourceComponent))] || REACT_STATICS;
const targetStatics = TYPE_STATICS[targetComponent['$$typeof']] || REACT_STATICS;
const sourceStatics = TYPE_STATICS[sourceComponent['$$typeof']] || REACT_STATICS;
for (let i = 0; i < keys.length; ++i) {
const key = keys[i];
@@ -3,6 +3,8 @@
var expect = require('chai').expect;
var React = require('react');
var PropTypes = require('prop-types');
var createReactClass = require('create-react-class');
var hoistNonReactStatics = require('../..');
@@ -14,6 +16,9 @@ describe('hoist-non-react-statics', function () {
statics: {
foo: 'bar'
},
propTypes: {
on: PropTypes.bool.isRequired
},
render: function () {
return null;
}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit e0846fe

Please sign in to comment.