Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Transitions] External ownerState is incorrectly forwarded to inner components #41187

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading