This commit is contained in:
Zhigang Fang
2016-10-20 12:29:58 +08:00
parent d5e9e2890e
commit 8909e61cfa
2 changed files with 9 additions and 8 deletions

View File

@@ -6,6 +6,8 @@ import Route from './src/Route'
import * as actions from './src/action'
import reducer from './src/reducer'
export const actions = actions
export const reducer = reducer
export const Route = Route
export {
actions,
reducer,
Route
}

View File

@@ -2,7 +2,7 @@
* @flow
*/
import { Component, Element } from 'react'
import React, { Component, Element } from 'react'
import { Navigator, BackAndroid } from 'react-native'
import { connect } from 'react-redux'
import _ from 'lodash'
@@ -73,13 +73,12 @@ class Router extends Component {
const mapProps = (store, props) => {
const mountPoint = props.routyMountPoint || 'routes'
const routes = store[mountPoint]
const routesMap = store[mountPoint]
const routes = props.routyGroup != null ? routesMap[props.routyGroup] : routesMap
if (routes == null) {
console.error(`No routes found in ${mountPoint}`)
}
return {
routes: routes[props.routyGroup]
}
return { routes }
}
const mapAction = (dispatch, props) => {