From d9d02c35736f36c3ce9eb7e3e228d4564dbeb4ef Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Thu, 28 Dec 2017 16:20:56 +0800 Subject: [PATCH] add proptypes for Description --- src/components/DescriptionList/Description.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/DescriptionList/Description.js b/src/components/DescriptionList/Description.js index 2aae62b2..1061e1a6 100644 --- a/src/components/DescriptionList/Description.js +++ b/src/components/DescriptionList/Description.js @@ -1,4 +1,5 @@ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import { Col } from 'antd'; import styles from './index.less'; @@ -14,4 +15,20 @@ const Description = ({ term, column, className, children, ...restProps }) => { ); }; +Description.defaultProps = { + term: '', + children: '', +}; + +Description.propTypes = { + term: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.element, + ]), + children: PropTypes.oneOfType([ + PropTypes.string, + PropTypes.element, + ]), +}; + export default Description; -- GitLab