Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
fix(navigation): Fixes Redux navigation middleware being called twice (
Browse files Browse the repository at this point in the history
  • Loading branch information
superp authored and jamonholmgren committed May 21, 2019
1 parent dd068c4 commit 2df24ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion boilerplate/App/Navigation/ReduxNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { connect } from 'react-redux'
import AppNavigation from './AppNavigation'

createReactNavigationReduxMiddleware(
export const appNavigatorMiddleware = createReactNavigationReduxMiddleware(
'root',
(state) => state.nav
)
Expand Down
8 changes: 2 additions & 6 deletions boilerplate/App/Redux/CreateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createStore, applyMiddleware, compose } from 'redux'
import Config from '../Config/DebugConfig'
import createSagaMiddleware from 'redux-saga'
import ScreenTracking from './ScreenTrackingMiddleware'
import { createReactNavigationReduxMiddleware } from 'react-navigation-redux-helpers'
import { appNavigatorMiddleware } from '../Navigation/ReduxNavigation'

// creates the store
export default (rootReducer, rootSaga) => {
Expand All @@ -12,11 +12,7 @@ export default (rootReducer, rootSaga) => {
const enhancers = []

/* ------------- Navigation Middleware ------------ */
const navigationMiddleware = createReactNavigationReduxMiddleware(
'root',
state => state.nav
)
middleware.push(navigationMiddleware)
middleware.push(appNavigatorMiddleware)

/* ------------- Analytics Middleware ------------- */
middleware.push(ScreenTracking)
Expand Down

0 comments on commit 2df24ef

Please sign in to comment.