Layout:
<div style={{ flex:1 }}>
<div className="sideBarContainer">
<div className="sideBar">
<div className="sideBarExtra"> <--- conditional
</div>
<div className="content"></div>
</div>
CSS:
.sideBarContainer {
display: flex;
flex-direction: row;
}
.sideBar {
height: 100vh;
min-width: 64px;
z-index: 99;
}
.content {
flex: 1;
transition: width .3s linear;
}
sideBarExtra conditionally renders using the react-tranisition-group CSSTransitionGroup component.
The sideBarExtra will slide in smoothly from left to right when it is rendered, and slide out right to left when it is removed.
The content div does not transition smoothly when sideBarExtra is added, it jumps to its spots.
Expected behaviour: content to smoothly slide to it's new width.
In the console dev tools I can see the content width being changed, but no transition animation is happening.