diff --git a/examples/react-native/Example.js b/examples/react-native/Example.js index a90ba79a0..1a57858e9 100644 --- a/examples/react-native/Example.js +++ b/examples/react-native/Example.js @@ -35,7 +35,7 @@ const styles = StyleSheet.create({ }, }); -const defaultReducer = Reducer(Actions); +const defaultReducer = new Reducer(); const reducerCreate = () => { return (state, action) => { console.log('reducer: ACTION:', action); diff --git a/package.json b/package.json index 13e5d85e9..d90b60ce6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-router-flux", - "version": "4.0.3", + "version": "4.0.4", "description": "React Native Router using Flux architecture", "repository": { "type": "git", diff --git a/src/Reducer.js b/src/Reducer.js index 184a960e9..e4bf7c911 100644 --- a/src/Reducer.js +++ b/src/Reducer.js @@ -5,6 +5,9 @@ import { getActiveState, popPrevious } from './State'; export default function createReducer(navigationStore) { return (state, action) => { + if (!navigationStore) { + navigationStore = require('./navigationStore').default; + } const { type, routeName } = action; if (type === ActionConst.POP_TO) { let nextScene = '';