I am trying to use Reactotron with react-native, and it worked flawlessly before trying it with Redux. Now it gives me an error as in the image:

This only happens when I use Reactotron.createStore, and it works as expected with the Redux createStore. I looked around the source code but couldn't figure out what is happening.. any idea? As you can see from the call stack, this is at initialization of the app.
Here is the source code:
const configureDevelopmentEnvironment = () => {
configureReactotron();
return configureDevStore();
}
const configureReactotron = () => {
const ReactotronSet = require('reactotron-react-native');
const reactotronRedux = require('reactotron-redux').reactotronRedux;
const Reactotron = ReactotronSet.default;
Reactotron
.configure()
.use(reactotronRedux())
.use(ReactotronSet.openInEditor())
.use(ReactotronSet.trackGlobalErrors())
.connect();
console.tron = Reactotron;
Reactotron.clear();
}
const configureDevStore = () => {
const dummyInitialState = require('./dummyInitialState').default;
const Reactotron = require('reactotron-react-native').default;
const store = Reactotron.createStore(reducersSet, dummyInitialState)
return store;
}
Library Versions:
Any help would be appreciated. Cheers!
P.S. Great tool, love it! :)
Looks like I have a bug in there. Can you try adding a 3rd parameter to the Reactotron.createStore() call?
Maybe just try something silly like:
import { compose } from 'redux'
Reactotron.createStore(reducersSet, dummyInitialState, compose([]))
I know it doesn't do anything, but it should fulfill the contract of what Reactotron.createStore is expecting. With 2 parameters, I think I'm incorrectly assigning position 2 to the middleware and not the initial state as you're expecting.
Thanks for a fantastic bug report!
Thanks for the prompt response. I think you are right, the bug is probably in the assignment of the initialState and enhancer.
I just did this:
const store = Reactotron.createStore(reducersSet, dummyInitialState, applyMiddleware())
and it is working as expected. Cheers!
Hello and thanks for Reactotron!
I'm seeing the same problem but I'm using a non-empty compose message and am not using any 'dummyInitialState'.
What parameters should I send to Reactotron.createStore? Below results in the f(composed) "Array is not a function" error.
return Reactotron.createStore(reducer, compose(
middleware,
createReactotronTrackingEnhancer(Reactotron, {})
));
What is middleware is your setup? Is it an array or a function that has run through applyMiddleware()?
Feel free to re-open if you're still stuck.
This works:
const store: Store = Reactotron.createStore(reducers,applyMiddleware());
But, this does not:
const store: Store = Reactotron.createStore(reducers);
It says that
a is not a function
Since the 'original' createStore accepts being called with one single parameter, I think Reactotron should have the same 'signature', 'interface' or behaviour.
I agree 100%. #468
Suggestion: Could add the applyMiddleware() part in the get started guide, I hit the "a is not a function" error too and was puzzled.
Unfortunately this is still a thing...
It still happened to me, 2018
store = reactotron.createStore(reducer); gives me a is not a function
store = reactotron.createStore(reducer, {}, applyMiddleware()); fixed the problem
Most helpful comment
Thanks for the prompt response. I think you are right, the bug is probably in the assignment of the initialState and enhancer.
I just did this:
and it is working as expected. Cheers!