Skip to content

Commit

Permalink
fix warn
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Sep 8, 2023
1 parent d4b9f51 commit f20aa08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/mui-material/src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ const Modal = React.forwardRef(function Modal(inProps, ref) {
elementType: RootSlot,
externalSlotProps: rootSlotProps,
externalForwardedProps: other,
getSlotProps: getRootProps,
getSlotProps: (otherHandlers) => {
const { onTransitionEnter, onTransitionExited, ...restOfHandlers } = otherHandlers;
return getRootProps(restOfHandlers);
},
additionalProps: {
ref,
as: component,
Expand Down
10 changes: 10 additions & 0 deletions packages/mui-material/src/Modal/Modal.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,4 +871,14 @@ describe('<Modal />', () => {
expect(getByTestId('backdrop')).to.have.class('custom-backdrop');
});
});

it.only('should not warn when onTransitionEnter and onTransitionExited are provided', () => {
expect(() => {
render(
<Modal open onTransitionEnter={() => {}} onTransitionExited={() => {}}>
<div />
</Modal>,
);
}).not.toErrorDev();
});
});

0 comments on commit f20aa08

Please sign in to comment.