Skip to content

Instantly share code, notes, and snippets.

@tphdev
Last active November 11, 2016 19:02
Show Gist options
  • Save tphdev/0b78d32aee3117573d53e5a869d5f55a to your computer and use it in GitHub Desktop.
Save tphdev/0b78d32aee3117573d53e5a869d5f55a to your computer and use it in GitHub Desktop.
View Controller for React Components
const React = require('react')
const HomeView = require('./component-homeview.js')
const ACTIONS = require('./actions.js')
const STORE = require('./store.js')
const AppViewController = React.createClass({
getInitialState: function(){
let startingState = {}
return startingState
},
componentWillMount: function(){
//STORE.onChange(...)
}
render: function(){
switch(this.props.routedFrom){
case: "HomeView"
return <HomeView />
break;
default:
return <div><h1>Yolo!!</h1></div>
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment