https://codesandbox.io/s/yp9lmvwo1x In this sandbox you can see the icon is an arrow and the rotation transition is perfectly fine. I'm using a + x for the icon, however, and I need a 45 degree rotation. How do I achieve this?
In the ExpansionPanelSummary source code you can find the syntax for the default styles controlling this:
'&$expanded': {
transform: 'translateY(-50%) rotate(180deg)',
},
You can get a 45 degree rotation by using the following:
expandIcon: {
"&$expanded": {
transform: "translateY(-50%) rotate(45deg)"
}
},
expanded: {}
then in the JSX:
<ExpansionPanelSummary
classes={{
expandIcon: classes.expandIcon,
expanded: classes.expanded
}}
expandIcon={<ExpandMoreIcon />}
>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With