Closed gandazgul closed 5 years ago
In:
var ClassName = _react2.default.createClass({
displayName: 'ClassName',
propTypes: {
string: _react2.default.PropTypes.string,
func: _react2.default.PropTypes.func,
boll: _react2.default.PropTypes.bool,
number: _react2.default.PropTypes.number,
},
render: function () { ... }
});
Out:
var ClassName = _react2.default.createClass({
displayName: 'ClassName',
render: function () { ... }
});
Could we add a test case? I thought we were already supporting that. Maybe there is a regression.
It doesn't work for me, the function is called createClass in React 16, so the search for the parent returns null. This fix is to both look for the funciona name in a different place (what I saw while debugging)a and the function name being createClass instead of createReactClass (which is an import).
I can add a test case, I'll research how to do that.
I think that we already have a test case for it.
You have a test case for the usage of the npm module create-react-class but not for this case which is re-parsing babel output.
I renamed the test case for create-react-class and added one for this case
Test cases and build passing, can we merge this?
@gandazgul Thank you!
Woohoo! Thank you!
So this is a third party library that ships their compiled code with propTypes, with this change it will removed.