From 00cb6141a74f374efb8a01218e4518ce691f1723 Mon Sep 17 00:00:00 2001 From: EduVencovsky <37600269+EduVencovsky@users.noreply.github.com> Date: Mon, 18 Jan 2021 08:39:59 -0300 Subject: [PATCH] Update example describing how one can provide a library theme type using 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 --- docs/typescript.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/typescript.mdx b/docs/typescript.mdx index 775296e90..25b2f9ebd 100644 --- a/docs/typescript.mdx +++ b/docs/typescript.mdx @@ -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 {} } ``` @@ -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; `