-
-
Save kimmobrunfeldt/f203bf67ab578fa507bf 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
const App = React.createClass({ | |
render() { | |
var page = this.props.currentPage; | |
return <div> | |
{page} | |
</div>; | |
} | |
}); |
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
// Version 1 | |
const LoginPage = React.createClass({ | |
render() { | |
return <div> | |
<h1>Login</h1> | |
<Login | |
loading={pageProps.loginLoading} | |
errorMessage={errorMessage} | |
dismissError={this._dismissError} | |
onSubmit={this._onSubmitLogin} /> | |
</div>; | |
} | |
}); | |
// Version 2 | |
// Sometimes it would be nice to do this instead, because I know there will be | |
// a wrapper div at App level | |
const LoginPage = React.createClass({ | |
render() { | |
return [ | |
<h1>Login</h1> | |
<Login | |
loading={pageProps.loginLoading} | |
errorMessage={errorMessage} | |
dismissError={this._dismissError} | |
onSubmit={this._onSubmitLogin} /> | |
]; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment