Version 7.14.0
Using intermediate destructuring of props in a class render method throws an exception. This seems to have been introduced in the v7.14.0 release
The following fails with VariableDeclarator ASTNodes are not handled by markPropTypesAsUsed:
render() {
const { chartData, chartTitle, loading, className } = this.props;
const { legendData, title, tooltip } = chartTitle;
...
Whereas the following passes:
render() {
const {
chartData,
chartTitle: { legendData, title, tooltip },
loading,
className
} = this.props;
...
Relevant propTypes are:
chartData: PropTypes.array.isRequired,
chartTitle: PropTypes.object.isRequired,
loading: PropTypes.bool.isRequired,
className: PropTypes.string
I didn't expect the intermediate destructuring to fail, but if it is invalid then it should fail cleanly rather than throw.
Duplicate of #2319. Fix is merged in master but waiting for release.
Just released v7.14.1 with the fix :slightly_smiling_face:
Great! thanks.
Most helpful comment
Duplicate of #2319. Fix is merged in master but waiting for release.