Skip to content

Commit

Permalink
Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 24, 2020
1 parent ac926aa commit 3211703
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ yarn add @material-ui/core

## Handling breaking changes

### BottomNavigation

- typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
```diff
-<BottomNavigation onChange={(event: React.ChangEvent<{}>) => {}} />
+<BottomNavigation onChange={(event: React.SyntheticEvent) => {}} />
```

### Divider

- Use border instead of background color. It prevents inconsistent height on scaled screens. For people customizing the color of the border, the change requires changing the override CSS property:
Expand All @@ -69,6 +77,14 @@ yarn add @material-ui/core
/>
```

### Slider

- typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
```diff
-<Slider onChange={(event: React.ChangEvent<{}>, value: unknown) => {}} />
+<Slider onChange={(event: React.SyntheticEvent, value: unknown) => {}} />
```

### TablePagination

- The customization of the table pagination's actions labels must be done with the `getItemAriaLabel` prop.
Expand All @@ -80,6 +96,14 @@ yarn add @material-ui/core
+ getItemAriaLabel={…}
```

### Tabs

- typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
```diff
-<Tabs onChange={(event: React.ChangEvent<{}>, value: unknown) => {}} />
+<Tabs onChange={(event: React.SyntheticEvent, value: unknown) => {}} />
```

### Typography

- Replace `srOnly` prop support with a style util:
Expand Down Expand Up @@ -133,3 +157,9 @@ yarn add @material-ui/core
-</ExpansionPanel>
+</Accordion>
```

- typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
```diff
-<Accordion onChange={(event: React.ChangEvent<{}>, expanded: boolean) => {}} />
+<Accordion onChange={(event: React.SyntheticEvent, expanded: boolean) => {}} />
```

0 comments on commit 3211703

Please sign in to comment.