Dva: 有支持react-native的计划吗?

Created on 22 Jul 2016  ·  8Comments  ·  Source: dvajs/dva

如题,期待可以支持!

Most helpful comment

0.0.15 已支持。

All 8 comments

感谢关注!react-native 除了不需要 router,其他都是一致的,1.0 之后会支持。https://github.com/dvajs/dva/issues/8

0.0.15 已支持。

react-native也是需要 router 的,常见的选择是 react-native-router-flux 。现在的0.0.15版想结合 react-native-router-flux很困难

@netfishx 困难点在哪? 印象中 react-native-router-flux 有自己的 action 体系,和 redux 这一套是分开用的。

事实上 react-native-router-flux 和 redux 同时使用的时候,常见的做法是把 react-native-router-flux 的 reducer 通过 combineReducers 合并到一起,这样可以在 redux 的 smart component 中访问 routes。但现在在 dva 的模型中,这一点很难做到。

如果只是需要 combile 额外的 reducer,目前是支持的。

const app = dva({
  extraReducers: { router: (state, action) => newState },
});

如果是这样,我粗心了。。。

btw:dva 项目整套工具链和思路跟我们现在一模一样,如果能继续完善下去,我们就不自己造轮子了。
期待越做越好

有Dva整合react-native-router-flux 的相关demo么~

Was this page helpful?
0 / 5 - 0 ratings