Skip to content

Commit

Permalink
fix: Auto ref on BottomSheet Header now use displayName too
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Jan 26, 2022
1 parent 2b6ce4c commit 0f1e067
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions react/BottomSheet/BottomSheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 0f1e067

Please sign in to comment.