Skip to content

Commit

Permalink
[material-ui][Transitions] External ownerState is incorrectly forward…
Browse files Browse the repository at this point in the history
…ed to inner components (#41187)
  • Loading branch information
gitstart authored Feb 20, 2024
1 parent daee6ef commit 633682d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 0 additions & 2 deletions packages/mui-material/src/Accordion/Accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ const Accordion = React.forwardRef(function Accordion(inProps, ref) {
ownerState,
});

delete transitionProps.ownerState;

return (
<AccordionRoot
className={clsx(classes.root, className)}
Expand Down
4 changes: 3 additions & 1 deletion packages/mui-material/src/Collapse/Collapse.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ const Collapse = React.forwardRef(function Collapse(inProps, ref) {
[isHorizontal ? 'minWidth' : 'minHeight']: collapsedSize,
...style,
}}
ownerState={{ ...ownerState, state }}
ref={handleRef}
{...childProps}
// `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`
// that might have been forwarded from the Transition component.
ownerState={{ ...ownerState, state }}
>
<CollapseWrapper
ownerState={{ ...ownerState, state }}
Expand Down

0 comments on commit 633682d

Please sign in to comment.