Skip to content

Commit

Permalink
Update example describing how one can provide a library theme type us…
Browse files Browse the repository at this point in the history
…ing interface augmentation (#2214)

* Update typescript.mdx

Add comment to make explicitly the fact that how you import the theme might change according to Material-UI version

* Update typescript.mdx

Change 3rd party theme example to a more generic example, showing that any library theme can be applied
  • Loading branch information
EduVencovsky authored Jan 18, 2021
1 parent 4d2e732 commit 00cb614
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,10 @@ declare module '@emotion/react' {

// You are also able to use a 3rd party theme this way:
import '@emotion/react'
import { MuiTheme } from 'material-ui'
import { LibTheme } from 'some-lib'

declare module '@emotion/react' {
export interface Theme extends MuiTheme {}
export interface Theme extends LibTheme {}
}
```

Expand All @@ -300,7 +300,7 @@ import styled from '@emotion/styled'

const Button = styled('button')`
padding: 20px;
background-color: ${props => props.theme.primary};
background-color: ${props => props.theme.someLibProperty};
border-radius: 3px;
`

Expand Down

0 comments on commit 00cb614

Please sign in to comment.