From 0f1e067cf19e5e83b5deb05453774c01d38e8f22 Mon Sep 17 00:00:00 2001 From: JF-Cozy Date: Wed, 26 Jan 2022 13:47:49 +0100 Subject: [PATCH] fix: Auto ref on BottomSheet Header now use displayName too --- react/BottomSheet/BottomSheet.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/react/BottomSheet/BottomSheet.jsx b/react/BottomSheet/BottomSheet.jsx index 46449f64e5..bd353f62c2 100644 --- a/react/BottomSheet/BottomSheet.jsx +++ b/react/BottomSheet/BottomSheet.jsx @@ -120,7 +120,10 @@ const BottomSheet = ({ toolbarProps, settings, children }) => { } const overriddenChildren = React.Children.map(children, child => { - if (child.type.name === 'BottomSheetHeader') { + if ( + child.type.name === 'BottomSheetHeader' || + child.type.displayName === 'BottomSheetHeader' + ) { return React.cloneElement(child, { headerContentRef }) } return child @@ -176,9 +179,9 @@ BottomSheet.propTypes = { /** Toolbar properties */ toolbarProps: PropTypes.shape({ /** React reference of the toolbar node */ - ref: PropTypes.bool, + ref: PropTypes.object, /** Toolbar height value */ - height: PropTypes.func + height: PropTypes.number }), /** Settings that can be modified */ settings: PropTypes.shape({