diff --git a/src/common/Popup/Label.js b/src/common/Popup/Label.js index 7ac97eee8..43ce357dd 100644 --- a/src/common/Popup/Label.js +++ b/src/common/Popup/Label.js @@ -1,7 +1,7 @@ import React from 'react'; -const Label = ({ children, forwardedRef, onClick }) => { - return React.cloneElement(React.Children.only(children), { ref: forwardedRef, onClick }); -}; +const Label = React.forwardRef(({ children, onClick }, ref) => { + return React.cloneElement(React.Children.only(children), { ref, onClick }); +}); export default Label; diff --git a/src/common/Popup/Popup.js b/src/common/Popup/Popup.js index fe480c220..e83462d3d 100644 --- a/src/common/Popup/Popup.js +++ b/src/common/Popup/Popup.js @@ -127,7 +127,7 @@ class Popup extends PureComponent { return ( {React.Children.map(this.props.children, (child) => { - return child.type === Label ? React.cloneElement(child, { forwardedRef: this.labelRef, onClick: this.open }) : null; + return child.type === Label ? React.cloneElement(child, { ref: this.labelRef, onClick: this.open }) : null; })} {this.renderMenu()}