Closed mmakarin closed 8 years ago
Source:
import React, { PropTypes } from "react"; export default class Table extends PureComponent { static propTypes = { columns: PropTypes.arrayOf(PropTypes.shape({ title: PropTypes.string, render: PropTypes.func })), data: PropTypes.array }; ...
Output
var Table = _wrapComponent("Table")((_temp = _class = function (_PureComponent) { _inherits(Table, _PureComponent); function Table() { _classCallCheck(this, Table); return _possibleConstructorReturn(this, Object.getPrototypeOf(Table).apply(this, arguments)); } _createClass(Table, [{ key: "render", value: function render() { ... } }]); return Table; }(_reactPureRender.PureComponent), _class.propTypes = { columns: _react2.PropTypes.arrayOf(_wrapComponent("_component")(_react2.PropTypes.shape({ title: _react2.PropTypes.string, render: _react2.PropTypes.func }))), data: _react2.PropTypes.array }, _temp));
And it fails on the line
var originalRender = ReactClass.prototype.render;
with the following error because PropTypes.Shape.prototype.render is undefined
Uncaught TypeError: Cannot read property 'render' of undefined wrapToCatchErrors @ index.js:30(anonymous function) @ Table.js:65(anonymous function) @ Table.js:151(anonymous function) ...
@mmakarin this doesn't look like any of the typecheck transforms, can you post the output when typecheck is disabled?
Oops. Excuse me. It's react-transform-catch-errors fault.
Source:
Output
And it fails on the line
with the following error because PropTypes.Shape.prototype.render is undefined