Last active
August 29, 2015 14:21
-
-
Save pragmaticlogic/002747bdfe3e36b748ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var Route = React.createClass({ | |
mixins: [RouterMixin], | |
routes: { | |
'/': 'home' | |
,'notfound/:userName': 'notfound' | |
,'dashboard/:userName': 'dashboard' | |
,'repos/:userName': 'repos' | |
}, | |
render: function() { | |
return this.renderCurrentRoute() | |
}, | |
home: function(userName) { | |
return <Main data = { null } /> | |
}, | |
notfound: function(userName) { | |
return <Main data = { userName }/> | |
}, | |
dashboard: function(userName) { | |
return <Dashboard data = { userName }/> | |
}, | |
repos: function(userName) { | |
return <Repos data = { userName }/> | |
}, | |
notFound: function(path) { | |
return <div class="not-found">Page is not found: {path}</div>; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment