I have two elements in react, wrapped in a slide:
<div className={classes.wrapper}>
<Switch
checked={checked}
onChange={this.handleChange}
aria-label="Collapse"
/>
<Slide
direction="left"
style={{ transitionDelay: !checked ? "10000ms" : "0ms" }}
in={checked}
timeout={1000}
mountOnEnter
unmountOnExit
>
<Paper elevation={4} className={classes.paper}>
<svg className={classes.svg}>
<polygon
points="0,100 50,00, 100,100"
className={classes.polygon}
/>
</svg>
</Paper>
</Slide>
<Slide
direction="left"
style={{ transitionDelay: checked ? "10000ms" : "0ms" }}
in={!checked}
timeout={1000}
mountOnEnter
unmountOnExit
>
<Paper elevation={4} className={classes.paper}>
<svg className={classes.svg}>
<polygon
points="0,100 50,00, 100,100"
className={classes.polygon2}
/>
</svg>
</Paper>
</Slide>
</div>
Full code shown here.
I'm trying to get one element to leave before the other one does, so that they swap, but it seems like that's not possible? I've tried various combinations of timeout, and transitionDelay, but I can't get one to leave before the other one arrives.