Fluxible Router 介绍
Fluxible Router Fluxible 应用程序的路由。
特征:
-
同构路由
-
高阶组件处理历史和路径
-
nevigateAction 可用于改变路径
-
更新至 React 0.13
-
遵循磁通流动
示例代码:
var Fluxible = require('fluxible'); var Router = require('fluxible-router'); var React = require('react'); // Component var App = React.createClass({ mixins: [Fluxible.FluxibleMixin], // Calls onChange when storeListeners emit change statics: { storeListeners: [Store] }, getinitialState: function () { return this.getStore(Store).getState(); }, onChange: function () { this.setState(this.getStore(Store).getState()); }, render: function () { return <span>{this.state.foo}</span> } }); // App var fluxibleApp = new Fluxible({ component: App }); fluxibleApp.registerStore(Store); // Bootstrap var context = fluxibleApp.createContext(); context.executeAction(action, 'bar', function () { console.log(React.renderToString(context.createElement())); });
Fluxible Router 官网
https://github.com/yahoo/fluxible-router
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。