Skip to content

Instantly share code, notes, and snippets.

@joecritch joecritch/Layout
Created Jul 8, 2014

Embed
What would you like to do?
Using Flux in react-nested-router
/**
* @jsx React.DOM
*/
var React = require('react');
var App = require('components/App/App.jsx');
var Layout = React.createClass({
render: function() {
var node = this.props.flux ? App : React.DOM.div;
return (
<node flux={this.props.flux}>
{this.props.activeRoute}
</node>
);
}
});
module.exports = Layout;
// .... << dependency set up >> ....
var flux = new Fluxxor.Flux(stores, actions);
React.renderComponent(
Route({handler: Layout, flux: flux},
Route({name: 'home', path: '/', handler: Home, flux: flux})
)
)
@joecritch

This comment has been minimized.

Copy link
Owner Author

joecritch commented Jul 8, 2014

This is an attempt to use Fluxxor within react-nested-router. Layout handles the rendering of the App component once this.props.flux is passed from the router.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.