Skip to content

Commit

Permalink
[docs] Document the Omit type removal + alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Feb 8, 2021
1 parent 1567dba commit d3e2487
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -1266,3 +1266,12 @@ As the core components use emotion as a styled engine, the props used by emotion
},
});
```

### `@material-ui/types`

- Rename the exported `Omit` type in `@material-ui/types`. The module is now called `DistributiveOmit`. The change removes the confusion with the built-in `Omit` helper introduced in TypeScript v3.5. The built-in `Omit`, while similar, is non-distributive. This leads to differences when applied to union types. [See this StackOverflow answer for further details](https://stackoverflow.com/a/57103940/1009797).

```diff
-import { Omit } from '@material-ui/types';
+import { DistributiveOmit } from '@material-ui/types';
```

0 comments on commit d3e2487

Please sign in to comment.