Does ex-navigation work with Reactotron and ReduxThunk?

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

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)
);

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 ~~~

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

Same error.

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

works after removing Immutable.

works with reactotron as well!

Thanks!

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

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

yeah, that makes sense. Thanks!!

1 Like