return (
            <div>
                <Nav selected={this.props.currentPageName} links={this.props.pages} />
                <Handler />
            </div>
        );
    },

    componentDidUpdate: function(prevProps, prevState) {
        const newProps = this.props;
        if (newProps.pageTitle === prevProps.pageTitle) {
            return;
        }
        document.title = newProps.pageTitle;
    }
});

export default handleHistory(provideContext(connectToStores(
    Application,
    [ApplicationStore],
    function (stores, props) {
        var appStore = stores.ApplicationStore;
        return {
            currentPageName: appStore.getCurrentPageName(),
            pageTitle: appStore.getPageTitle(),
            pages: appStore.getPages()
        };
    }
)));
Exemplo n.º 2
0
'use strict';
/**
 * @author <a href="mailto:stefanmayer13@gmail.com">Stefan Mayer</a>
 */

const React = require('react/addons');
const Router = require('react-router');
const provideContext = require('fluxible/addons/provideContext');

const RouteHandler = Router.RouteHandler;

const App = React.createClass({
    render() {
        return (
            <div>
                <RouteHandler />
                <footer>@Stefan Mayer &lt;stefanmayer13@gmail.com&gt;</footer>
            </div>
        );
    }
});

module.exports = provideContext(App);