@dva-rn/dva-rn

0.3.7 • Public • Published

dva-rn

支持 react-native && typescript 的 dva

支持

  • react-native
  • react-native-web
  • react-router-cache-route 支持web 的cache路由

react-native 中使用的是 react-navigation。 react-native-web 中使用的 react-router-dom。 后续会继续更新完善相关API。

安装

yarn add react-navigation react-native-gesture-handler @dva-rn/dva-rn
react-native link

样例

详细情况请看 样例

import {
  Dva,
  IModel,
  routerRedux,
  connect,
  createBrowserHistory
} from "@dva-rn/dva-rn";
import App from "./App";
import B from "./B";

const dva = new Dva({
  routerConfigs: {
    path: "/",
    routes: [{ path: "/a/:id", component: App, cache:{
      when:"forward" 
    } }, { path: "/b", component: B }]
  },
  history: createBrowserHistory()
});

dva.model(countModel);

const App = dva.start();

export default App;

License

MIT

Package Sidebar

Install

npm i @dva-rn/dva-rn

Weekly Downloads

0

Version

0.3.7

License

MIT

Unpacked Size

18.7 kB

Total Files

17

Last publish

Collaborators

  • dva-rn