import React from "react{{#if isRouteHandler}}/addons{{/if}}";{{#if stores}} {{#if stores}}import {StoreListenerMixin} from "fluxd";{{/if}} {{#each stores}}import {{this}} from "../stores/{{this}}.js"; {{/each}}{{/if}}{{#if isRouteHandler}} import {RouteHandler, State as RouterStateMixin} from "react-router";{{/if}} var {{componentName}} = React.createClass({ {{#if mixins}} mixins: [{{mixins}}], {{/if}}{{#if isRouteHandler}} statics: { fetchData(params, query) { }, willTransitionTo(transition, params) { } }, {{/if}} propTypes: { }, getInitialState() { {{#if stores}} {{#each stores}} var {{storeState this}} = {{this}}.getState(); {{/each}} {{/if}} {{#if isRouteHandler}} var params = this.getParams(); var query = this.getQuery(); {{/if}} return {}; }, getDefaultProps() { return {}; },{{#if stores}} componentDidMount() { {{#each stores}} this.listenTo({{this}}, this.onStoreChange); {{/each}} }, onStoreChange() { this.setState(this.getInitialState()); },{{/if}} render() { return (