An open API service indexing awesome lists of open source software.

https://github.com/ph-fritsche/repro-storybook-muitheme


https://github.com/ph-fritsche/repro-storybook-muitheme

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

**Material-UI theme does not work in Storybook**

1. Install
```
yarn install
```
2. Run

a. CRA
```
yarn react-scripts start
```
b. Storybook
```
yarn start-storybook
```

## Component

```jsx
import React from 'react'
import { Button } from '@mui/material'
import { ThemeProvider, createTheme } from '@mui/material/styles'

export function ThemedButton() {
return (

foo

)
}
```

## Result

In CRA | In Storybook
-- | --
![image](https://user-images.githubusercontent.com/39068198/137137981-8bb0fec9-b143-424c-9e5d-3e62bad9bf80.png) | ![image](https://user-images.githubusercontent.com/39068198/137138043-8cfdd94a-8029-47b3-9501-5251a2e0dff4.png)

## Workaround

https://github.com/storybookjs/storybook/issues/10231#issuecomment-751239488