# @lighthouseapps/react-native-dva

> React Native Dva for Android and iOS

Latest version **1.2.6** (published 2020-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lighthouseapps/react-native-dva
pnpm add @lighthouseapps/react-native-dva
yarn add @lighthouseapps/react-native-dva
bun add @lighthouseapps/react-native-dva
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2020-12-08 |
| First published | 2019-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 20.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alvaro Silveira |
| Maintainers | alvarosilveiraa, donnes |
| Keywords | react-native, dva |

## Links

- npm: https://www.npmjs.com/package/@lighthouseapps/react-native-dva
- Repository: https://gitlab.com/lighthouseit/packages/react-native-dva
- Homepage: https://gitlab.com/lighthouseit/packages/react-native-dva#readme
- Issues: https://gitlab.com/lighthouseit/packages/react-native-dva/issues
- npm.io page: https://npm.io/package/@lighthouseapps/react-native-dva

## Dependencies (11)

- [qs](https://npm.io/package/qs.md) ^6.9.1
- [dva-core](https://npm.io/package/dva-core.md) ^1.4.0
- [dva-loading](https://npm.io/package/dva-loading.md) ^3.0.10
- [react-redux](https://npm.io/package/react-redux.md) ^7.1.0
- [redux-persist](https://npm.io/package/redux-persist.md) ^6.0.0
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^6.1.0
- [react-native-screens](https://npm.io/package/react-native-screens.md) ^2.0.0-alpha.32
- [react-navigation-tabs](https://npm.io/package/react-navigation-tabs.md) ^2.6.2
- [react-navigation-stack](https://npm.io/package/react-navigation-stack.md) ^1.10.3
- [react-navigation-drawer](https://npm.io/package/react-navigation-drawer.md) ^2.3.3
- [react-navigation-redux-helpers](https://npm.io/package/react-navigation-redux-helpers.md) ^3.0.2

## Recent versions

- 1.2.6 (latest) — 2020-12-08
- 1.2.5 — 2020-11-19
- 1.2.4 — 2020-10-16
- 1.2.3 — 2020-10-16
- 1.2.2 — 2020-09-15
- 1.2.1 — 2020-03-30
- 1.2.0 — 2020-03-26
- 1.1.9 — 2020-03-13
- 1.1.8 — 2020-02-13
- 1.1.7 — 2020-02-12
- 1.1.6 — 2020-02-12
- 1.1.5 — 2020-02-12
- 1.1.3 — 2020-02-10
- 1.1.2 — 2020-02-07
- 1.1.1 — 2020-02-06
- … 4 more at https://npm.io/package/@lighthouseapps/react-native-dva/versions

## README

# react-native-dva
> React Native Dva for Android and iOS

## Getting started
`$ npm i @lighthouseapps/react-native-dva --save`

## Usage
```javascript
// ./src/models/app.js
export default {
  namespace: 'app',
  state: {},
  effects: {},
  reducers: {},
  subscriptions: {}
};

// ./src/models/index.js
import app from './app';

export default [
  app
];

// ./src/router.js
import {
  LoadingScreen,
  SigninScreen,
  HomeScreen
} from './screens';
import {
  AppLayout
} from './layouts';

export default {
  type: 'switch',
  routes: [
    {
      type: 'screen',
      name: 'Loading',
      layout: null,
      component: LoadingScreen
    },
    {
      type: 'screen',
      name: 'Signin',
      layout: null,
      component: SigninScreen
    },
    {
      type: 'stack',
      name: 'App',
      layout: null,
      routes: [
        {
          type: 'screen',
          name: 'Books',
          layout: null,
          component: HomeScreen
        }
      ],
      options: {}
    }
  ],
  layout: AppLayout,
  options: {}
}

// index.js
import React from 'react';
import dva, {
  createRouter
} from 'react-native-dva';
import App from './App';
import models from './src/models';
import router from './src/router';
import {
  name
} from './app.json';

const {
  routerMiddleware,
  routerReducer,
  Router
} = createRouter(router);

const app = dva({
  models,
  extraReducers: { router: routerReducer },
  onAction: [ routerMiddleware ]
});

app.start(name, <Router />);
```

---
_Source: https://npm.io/package/@lighthouseapps/react-native-dva · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
