Material-ui: [Accordion] Summary and Styled-components

Created on 13 Nov 2018  路  1Comment  路  Source: mui-org/material-ui

When ExpansionPanelSummary is being converted to a styled-component, the entire ExpansionPanel disappears.

  • [x] This is not a v0.x issue.
  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

ExpansionPanel should not disappear after ExpansionPanelSummary is converted to a styled-component. Just conversion of ExpansionPanel does not yield such results..

Current Behavior

ExpansionPanel does not get rendered and it generally looks different in Chrome's Element inspector.

Steps to Reproduce


Link: https://codesandbox.io/s/olml3lkwwq

  1. Remove S. prefix from ExpansionPanelSummary - ExpansionPanel appears.
  2. Add it back - ExpansionPanel disappears.

Context

I am simply trying to style all Material-UI components with styled-components.

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI/core | v1.4.3 |
| React | 16.4.2 |
| Browser | Chrome 70+ |
| TypeScript | 3.0.1 |
| Styled-Components | 3.4.2 |

Accordion question

Most helpful comment

@LAITONEN One line change and you are good to go:

S.ExpansionPanelSummary.muiName = "ExpansionPanelSummary";

We document it in https://material-ui.com/guides/composition/#wrapping-components.

>All comments

@LAITONEN One line change and you are good to go:

S.ExpansionPanelSummary.muiName = "ExpansionPanelSummary";

We document it in https://material-ui.com/guides/composition/#wrapping-components.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

finaiized picture finaiized  路  3Comments

reflog picture reflog  路  3Comments

mb-copart picture mb-copart  路  3Comments

zabojad picture zabojad  路  3Comments