From e5b22fbfc9fee3bb1fdcdd2fb25163747db1ba3f Mon Sep 17 00:00:00 2001 From: tengge1 <930372551@qq.com> Date: Fri, 31 May 2019 22:19:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.UI/src/table/DataGrid.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ShadowEditor.UI/src/table/DataGrid.jsx b/ShadowEditor.UI/src/table/DataGrid.jsx index b8483f7b..19fca182 100644 --- a/ShadowEditor.UI/src/table/DataGrid.jsx +++ b/ShadowEditor.UI/src/table/DataGrid.jsx @@ -36,7 +36,12 @@ class DataGrid extends React.Component { DataGrid.propTypes = { className: PropTypes.string, style: PropTypes.object, - children: PropTypes.instanceOf(Columns), + children: (props, propName, componentName) => { + const children = props[propName]; + if (children.type !== Columns) { + return new TypeError(`Invalid prop \`${propName}\` of type \`${children.type.name}\` supplied to \`${componentName}\`, expected \`Columns\`.`); + } + }, data: PropTypes.array, };