Skip to content

Commit

Permalink
update getChildRef logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jul 3, 2024
1 parent 7fa5eda commit 2f926cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/mui-material/src/utils/getChildRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export default function getChildRef(children) {
}
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in React 18
// below check is to ensure 'ref' is accessible in both cases
return Object.keys(children.props).includes('ref') ? children.props.ref : children.ref;
return children.props.propertyIsEnumerable('ref') ? children.props.ref : children.ref;
}

0 comments on commit 2f926cd

Please sign in to comment.