Does ex-navigation work with Reactotron and ReduxThunk?

#1

Hi,

I’m using Reactotron and ReduxThunk.
My current store setup looks like:

const Reactotron = require('reactotron-react-native').default;
store = Reactotron.createStore(rootReducer, initialState, applyMiddleware(ReduxThunk));

How can I use createNavigationEnabledStore in my setup?
Can I still use ex-navigation without using createNavigationEnabledStore?

Thanks

#2

hello! i have no idea how to use reactotron but based on the signature of ex-navigation createNavigationEnabledStore you should be able to just pass in Reactotron.createStore as the first param:

let store = createNavigationEnabledStore(Reactotron.createStore)(
  rootReducer,
  initialState,
  applyMiddleware(ReduxThunk)
);
#3

Thanks a lot for your quick response!
Now I’m getting

Possible Unhandled Promise Rejection (id: 0):  
TypeError: undefined is not an object (evaluating 'navigationState.navigators')
      getStateForNavigatorId@...

Any ideas?

My code looks like this:

const rootReducer = combineReducers({
  navigation: NavigationReducer,
  auth: AuthReducer,
  note: NoteReducer,
});

store = createNavigationEnabledStore({
        createStore: Reactotron.createStore, 
        navigationStateKey: 'navigation',
      })(
        rootReducer,
        initialState,
        applyMiddleware(ReduxThunk)
      );

My state looks like this

navigation: 
  navigators:{}
  alerts:{}
  currentNavigatorUID:~~~ null ~~~
#4

do you have it working without reactotron? i’d try that first

#5

Same error.

It might be related to the fact that I’m using redux-immutable and immutable :0

#6

works after removing Immutable.

works with reactotron as well!

Thanks!

#7

Any workaround to make ex-navigation to work with immutable?

#8

i don’t know anything about redux-immutable but it should work fine with just immutable if you use that as the basis for your reducers

#9

yeah, that makes sense. Thanks!!

1 Like