From 2090db87959b7a1110abea6bf6171b2e3c1cb062 Mon Sep 17 00:00:00 2001 From: Ilya Oleshko Date: Mon, 9 Sep 2019 16:45:07 +0300 Subject: [PATCH] web: Components: Fixed property warning`s at DropDown component. --- .../src/components/drop-down/index.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/web/ASC.Web.Components/src/components/drop-down/index.js b/web/ASC.Web.Components/src/components/drop-down/index.js index d0909b7ef1..2e4cbe6d64 100644 --- a/web/ASC.Web.Components/src/components/drop-down/index.js +++ b/web/ASC.Web.Components/src/components/drop-down/index.js @@ -55,6 +55,12 @@ const Row = memo(({ data, index, style }) => { ); }); +Row.propTypes = { + data: PropTypes.any, + index: PropTypes.number, + style: PropTypes.object +}; + class DropDown extends React.PureComponent { constructor(props) { @@ -65,7 +71,7 @@ class DropDown extends React.PureComponent { }; this.dropDown = React.createRef(); - }; + } setDropDownWidthState = () => { if (this.dropDown.current) { @@ -77,13 +83,13 @@ class DropDown extends React.PureComponent { componentDidMount () { this.setDropDownWidthState(); - }; + } componentDidUpdate(prevProps) { if (this.props.opened !== prevProps.opened || this.props.isOpen !== prevProps.isOpen) { this.setDropDownWidthState(); } - }; + } render() { const {maxHeight, withArrow, directionX, children} = this.props; @@ -111,9 +117,12 @@ class DropDown extends React.PureComponent { ); } -}; +} DropDown.propTypes = { + opened: PropTypes.bool, + isOpen: PropTypes.bool, + children: PropTypes.any, directionX: PropTypes.oneOf(['left', 'right']), directionY: PropTypes.oneOf(['bottom', 'top']), withArrow: PropTypes.bool,