Skip to content

Commit

Permalink
[docs] Fix some apostrophe in TypeScript doc (#15757)
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDDanica authored and oliviertassinari committed May 20, 2019
1 parent d0296a8 commit 0b10f8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/pages/guides/typescript/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ const styles = createStyles({
});
```

However to allow these styles to pass TypeScript the definitions have to be ambiguous concerning names for CSS classes and actual CSS property names. Due to this class names that are equal to CSS properties should be avoided.
However to allow these styles to pass TypeScript, the definitions have to be ambiguous concerning names for CSS classes and actual CSS property names. Due to this class names that are equal to CSS properties should be avoided.

```ts
// error because TypeScript thinks `@media (min-width: 960px)` is a class name
Expand Down Expand Up @@ -151,7 +151,7 @@ interface Props {
}
```

However this isn't very [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) because it requires you to maintain the class names (`'root'`, `'paper'`, `'button'`, ...) in two different places. We provide a type operator `WithStyles` to help with this, so that you can just write
However this isn't very [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) because it requires you to maintain the class names (`'root'`, `'paper'`, `'button'`, ...) in two different places. We provide a type operator `WithStyles` to help with this, so that you can just write:

```ts
import { WithStyles, createStyles } from '@material-ui/core';
Expand Down Expand Up @@ -251,8 +251,8 @@ const theme = createMyTheme({ appDrawer: { breakpoint: 'md' }});
## Usage of `component` property
Material-UI allows you to replace a component's root node via a `component` property.
For example, a `Button`'s root node can be replaced with a React Router `Link`, and any additional props that are passed to `Button`, such as `to`, will be spread to the `Link` component. For a code
example concerning `Button` and `react-router-dom` checkout [this Button demo](/components/buttons/#third-party-routing-library)
example concerning `Button` and `react-router-dom` checkout [this Button demo](/components/buttons/#third-party-routing-library).

Not every component fully supports any component type you pass in. If you encounter a
component that rejects its `component` props in TypeScript please open an issue.
There is an ongoing effort to fix this by making component props generic.
There is an ongoing effort to fix this by making component props generic.

0 comments on commit 0b10f8d

Please sign in to comment.