diff --git a/package.json b/package.json index 971416668..98568d0f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-router-flux", - "version": "4.0.4", + "version": "4.0.5", "description": "React Native Router using Flux architecture", "repository": { "type": "git", diff --git a/src/Reducer.js b/src/Reducer.js index e4bf7c911..d807e756b 100644 --- a/src/Reducer.js +++ b/src/Reducer.js @@ -3,11 +3,9 @@ import { NavigationActions, StackActions } from 'react-navigation'; import * as ActionConst from './ActionConst'; import { getActiveState, popPrevious } from './State'; -export default function createReducer(navigationStore) { +export default function createReducer() { return (state, action) => { - if (!navigationStore) { - navigationStore = require('./navigationStore').default; - } + const navigationStore = require('./navigationStore').default; const { type, routeName } = action; if (type === ActionConst.POP_TO) { let nextScene = ''; diff --git a/src/navigationStore.js b/src/navigationStore.js index 98839a472..f9c6ffc60 100644 --- a/src/navigationStore.js +++ b/src/navigationStore.js @@ -520,7 +520,7 @@ class NavigationStore { setCustomReducer = (Navigator) => { this.getStateForAction = Navigator.router.getStateForAction; - const reducer = createReducer(this); + const reducer = createReducer(); Navigator.router.getStateForAction = (cmd, state) => (this.reducer ? this.reducer(state, cmd) : reducer(state, cmd)); };