Created
August 26, 2015 18:27
-
-
Save christianalfoni/3d3631eb03366ab71353 to your computer and use it in GitHub Desktop.
transition group problems
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 {Decorator as Cerebral} from 'cerebral-react'; | |
import {CSSTransitionGroup} from 'react-addons'; | |
import Home from './Home.js'; | |
import Admin from './Admin.js'; | |
@Cerebral({ | |
title: ['title'], | |
currentPage: ['currentPage'] | |
}) | |
class App extends React.Component { | |
renderPage() { | |
switch (this.props.currentPage) { | |
case 'home': | |
return <Home key="home"/>; | |
case 'admin': | |
return <Admin key="admin"/>; | |
} | |
} | |
render() { | |
return ( | |
<div> | |
<a href="/">Home</a> - <a href="/admin">Admin</a> | |
<h1>{this.props.title}</h1> | |
<CSSTransitionGroup transitionName="example"> | |
{this.renderPage()} | |
</CSSTransitionGroup> | |
</div> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment