I have a component that can render different components. I'd like to have an animated transition when the rendered components change.
Example:
class Container extends React.Component {
state = {
showing: 'primary'
}
render () {
const { showing } = this.state
const whichComponent = (showing === 'primary') ? <Primary /> : <Secondary />
return (
<div>
{whichComponent}
</div>
)
}
}
When the state changes and the "Secondary" component is rendered, I'd like to introduce a transition that essentially does SlideOut and SlideIn (but I'll take anything at this point).
I've tried react-transition-group to no avail and I just can't seem to find anything that works. Any tips or pointers in the right direction, would be greatly appreciated.