Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以配置react router 4.0 吗 #965

Closed
zpzxgcr opened this issue Jun 9, 2017 · 8 comments
Closed

可以配置react router 4.0 吗 #965

zpzxgcr opened this issue Jun 9, 2017 · 8 comments

Comments

@zpzxgcr
Copy link

zpzxgcr commented Jun 9, 2017

求解

@iamzhouyi
Copy link

同问,有支持4.0的计划吗?

@jindada
Copy link
Contributor

jindada commented Jun 13, 2017

同问

@Superman-wc
Copy link

希望尽快支持react-router@4.x

@nihgwu
Copy link
Member

nihgwu commented Jun 18, 2017

其实 dva 的核心并没有跟 react-router 绑死,完全可以自己使用 react-router v4,直接自定义 dva 的初始化方式即可:

import createHistory from 'history/createBrowserHistory'
import {
  ConnectedRouter,
  routerMiddleware,
  routerReducer as routing,
} from 'react-router-redux';

import createDva from 'dva/lib/createDva';

const history = createHistory();

const dva = createDva({
  mobile: false,
  initialReducer: {
    routing,
  },
  defaultHistory: history,
  routerMiddleware,
  setupHistory(history) {
    this._history = history;
  },
});

@nihgwu
Copy link
Member

nihgwu commented Jun 18, 2017

@sorrycc dva V2 什么时候进入实质开发啊,其实 dva-core 可以先分离出来了,我都想fork一份自己搞了,等得让人心焦 😂

@git-xyz
Copy link

git-xyz commented Jun 20, 2017

@nihgwu 支持你

@Pines-Cheng
Copy link

@nihgwu 表示只用了dva-core。。。

@sorrycc
Copy link
Member

sorrycc commented Jul 5, 2017

抱歉,拖了太久了。已经在写了,尽快完成。https://github.com/dvajs/dva-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants