-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
hi,
when i use the model i found the css transition didn't work as normal.
and the demo such like this:
const Styled = createStyled(theme => ({
appBar: {
width: '100%',
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
},
appBarShift: {
width: '50%',
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
},
}), { withTheme: true });
<MyHeader className={classNames(showDrawler ? classes.appBar : classes.appBarShift)} />
but it work like this
@withStyles((theme) => ({
appBar: {
width: '100%',
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.sharp,
duration: theme.transitions.duration.leavingScreen,
}),
},
appBarShift: {
width: '50%',
transition: theme.transitions.create(['margin', 'width'], {
easing: theme.transitions.easing.easeOut,
duration: theme.transitions.duration.enteringScreen,
}),
},
}), {withTheme: true})
class TestHeader extends Component {
render() {
const { classes } = this.props;
return (
<MyHeader className={classNames(showDrawler ? classes.appBar : classes.appBarShift)} />
)
}
}
Metadata
Metadata
Assignees
Labels
No labels