Skip to content

Commit

Permalink
[Modal][material] Fix console warning when onTransitionEnter , onTran…
Browse files Browse the repository at this point in the history
…sitionExit provided (#38868)
  • Loading branch information
sai6855 authored Sep 8, 2023
1 parent 3d2fb8a commit 34c1ffc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/mui-material/src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const Modal = React.forwardRef(function Modal(inProps, ref) {
keepMounted = false,
onBackdropClick,
onClose,
onTransitionEnter,
onTransitionExited,
open,
slotProps,
slots,
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('should not warn when onTransitionEnter and onTransitionExited are provided', () => {
expect(() => {
render(
<Modal open onTransitionEnter={() => {}} onTransitionExited={() => {}}>
<div />
</Modal>,
);
}).not.toErrorDev();
});
});

0 comments on commit 34c1ffc

Please sign in to comment.