Skip to content

Commit

Permalink
polish changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Nov 19, 2020
1 parent 85e6c93 commit 1cff479
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,19 @@ const classes = makeStyles(theme => ({
/>
```

- Remove `disableBackdropClick` prop.
Ignore close events from `onClose` when `reason === "backdropClick"` instead
- Remove the `disableBackdropClick` prop because redundant.
Ignore close events from `onClose` when `reason === 'backdropClick'` instead.

```diff
<Dialog
disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== "backdropClick") {
+ onClose(event, reason);
+ }
+ }}
/>;
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== 'backdropClick') {
+ onClose(event, reason);
+ }
+ }}
/>
```

- [withMobileDialog] Remove this higher-order component. The hook API allows a simpler and more flexible solution:
Expand Down Expand Up @@ -600,33 +600,33 @@ const classes = makeStyles(theme => ({

### Modal

- Remove `disableBackdropClick` prop.
Ignore close events from `onClose` when `reason === "backdropClick"` instead
- Remove the `disableBackdropClick` prop because redundant.
Ignore close events from `onClose` when `reason === 'backdropClick'` instead.

```diff
<Modal
disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== "backdropClick") {
+ onClose(event, reason);
+ }
+ }}
/>;
- disableBackdropClick
- onClose={handleClose}
+ onClose={(event, reason) => {
+ if (reason !== 'backdropClick') {
+ onClose(event, reason);
+ }
+ }}
/>
```

- Remove `onEscapeKeyDown` prop.
- Remove the `onEscapeKeyDown` prop because redundant.
Use `onClose` with `reason === "escapeKeyDown"` instead.

```diff
<Modal
- onEscapeKeyDown={handleEscapeKeyDown}
+ onClose={(event, reason) => {
+ if (reason === "escapeKeyDown") {
+ handleEscapeKeyDown(event);
+ }
+ }}
/>;
- onEscapeKeyDown={handleEscapeKeyDown}
+ onClose={(event, reason) => {
+ if (reason === 'escapeKeyDown') {
+ handleEscapeKeyDown(event);
+ }
+ }}
/>
```

- Remove `onRendered` prop.
Expand Down

0 comments on commit 1cff479

Please sign in to comment.