Last active
August 9, 2018 13:44
-
-
Save fabe/f24edbdaeed0473cfab6294c291b79c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { CSSTransition, TransitionGroup } from 'react-transition-group'; | |
export const replaceComponentRenderer = ({ props }) => { | |
const children = React.createElement(props.pageResources.component, props); | |
return ( | |
<div> | |
<TransitionGroup> | |
<CSSTransition key={props['*']} timeout={200} classNames="fade"> | |
<div | |
style={{ | |
position: 'absolute', | |
width: '100%', | |
backgroundColor: '#fff', | |
}} | |
> | |
{children} | |
</div> | |
</CSSTransition> | |
</TransitionGroup> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment