diff --git a/docs/pages/api-docs/dialog.md b/docs/pages/api-docs/dialog.md index 0ffc7466cf7641..b4b8ae7712bf71 100644 --- a/docs/pages/api-docs/dialog.md +++ b/docs/pages/api-docs/dialog.md @@ -39,13 +39,13 @@ The `MuiDialog` name can be used for providing [default props](/customization/gl | maxWidth | 'lg'
| 'md'
| 'sm'
| 'xl'
| 'xs'
| false
| 'sm' | Determine the max-width of the dialog. The dialog width grows with the size of the screen. Set to `false` to disable `maxWidth`. | | onBackdropClick | func | | Callback fired when the backdrop is clicked. | | onClose | func | | Callback fired when the component requests to be closed.

**Signature:**
`function(event: object, reason: string) => void`
*event:* The event source of the callback.
*reason:* Can be: `"escapeKeyDown"`, `"backdropClick"`. | -| onEnter | func | | Callback fired before the dialog enters. | -| onEntered | func | | Callback fired when the dialog has entered. | -| onEntering | func | | Callback fired when the dialog is entering. | +| ~~onEnter~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired before the dialog enters. | +| ~~onEntered~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired when the dialog has entered. | +| ~~onEntering~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired when the dialog is entering. | | onEscapeKeyDown | func | | Callback fired when the escape key is pressed, `disableKeyboard` is false and the modal is in focus. | -| onExit | func | | Callback fired before the dialog exits. | -| onExited | func | | Callback fired when the dialog has exited. | -| onExiting | func | | Callback fired when the dialog is exiting. | +| ~~onExit~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired before the dialog exits. | +| ~~onExited~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired when the dialog has exited. | +| ~~onExiting~~ | func | | *Deprecated*. Use the `TransitionProps` property instead.

Callback fired when the dialog is exiting. | | open* | bool | | If `true`, the Dialog is open. | | PaperComponent | elementType | Paper | The component used to render the body of the dialog. | | PaperProps | object | {} | Props applied to the [`Paper`](/api/paper/) element. | diff --git a/packages/material-ui/src/Dialog/Dialog.js b/packages/material-ui/src/Dialog/Dialog.js index 54d2db7a8129ca..6ef22dde80c7ff 100644 --- a/packages/material-ui/src/Dialog/Dialog.js +++ b/packages/material-ui/src/Dialog/Dialog.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import clsx from 'clsx'; import withStyles from '../styles/withStyles'; import capitalize from '../utils/capitalize'; +import deprecatedPropType from '../utils/deprecatedPropType'; import Modal from '../Modal'; import Backdrop from '../Backdrop'; import Fade from '../Fade'; @@ -330,15 +331,15 @@ Dialog.propTypes = { /** * Callback fired before the dialog enters. */ - onEnter: PropTypes.func, + onEnter: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * Callback fired when the dialog has entered. */ - onEntered: PropTypes.func, + onEntered: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * Callback fired when the dialog is entering. */ - onEntering: PropTypes.func, + onEntering: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * Callback fired when the escape key is pressed, * `disableKeyboard` is false and the modal is in focus. @@ -347,15 +348,15 @@ Dialog.propTypes = { /** * Callback fired before the dialog exits. */ - onExit: PropTypes.func, + onExit: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * Callback fired when the dialog has exited. */ - onExited: PropTypes.func, + onExited: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * Callback fired when the dialog is exiting. */ - onExiting: PropTypes.func, + onExiting: deprecatedPropType(PropTypes.func, 'Use the `TransitionProps` property instead.'), /** * If `true`, the Dialog is open. */