Last active
July 11, 2017 08:11
-
-
Save hololoev/da3a0d577bd355a3cf2ca50b7746d687 to your computer and use it in GitHub Desktop.
Problem with reflux 6.4.1
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
// file actions.js | |
const React = require('react'); | |
const Reflux = require('reflux'); | |
var Actions = Reflux.createActions([ | |
'testAction', | |
]); | |
module.exports = Actions; | |
// file store.js | |
const React = require('react'); | |
const Reflux = require('reflux'); | |
const PageActions = require('./actions'); | |
class Store extends Reflux.Store { | |
constructor() { | |
super(); | |
this.state = { | |
anystate: 'abc' | |
}; | |
this.listenables = PageActions; | |
} | |
} | |
// file index.js | |
module.exports = Store; | |
const React = require('react'); | |
const Reflux = require('reflux'); | |
const PageActions = require('./actions'); | |
const PageStore = require('./store'); | |
class Page extends Reflux.Component { | |
constructor(props) { | |
super(props); | |
this.store = PageStore; | |
} | |
componentDidMount() { | |
//PageActions.loadBHInfo(1); | |
} | |
bhRefresh(e, name) { | |
//PageActions.refreshBH(name); | |
} | |
render() { | |
return ( | |
<div> | |
<h1>TEST</h1> | |
</div> | |
) | |
} | |
} | |
ReactDom.render( | |
<Page />, | |
document.getElementById('root') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment