question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

null is not an object (evaluating 'reduxStore.getState')

See original GitHub issue
2017-01-04 2 17 47

I met this error. When I refresh several times, sometimes it runs.

This is my files

// reactoron-config.js
import Reactotron, { trackGlobalErrors } from 'reactotron-react-native';
import apisaucePlugin from 'reactotron-apisauce';  // <--- import
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';

console.tron = Reactotron;

Reactotron
  .configure() // we can use plugins here -- more on this later
  .use(trackGlobalErrors()) // <--- here we go!
  .use(apisaucePlugin())
  .use(reactotronRedux())
  .use(sagaPlugin())
  .connect(); // let's connect!

export default Reactotron;
// configureStore.js
import { applyMiddleware, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import thunk from 'redux-thunk';

import Reactotron from '../../env/reactotron-config';

import reducers from '../ducks';
import rootSaga from '../saga';

import googleAnalytics from './middleware/googleAnalytics';

const isDebuggingInChrome = __DEV__ && !!window.navigator.userAgent;
const sagaMonitor = Reactotron.createSagaMonitor();

function configureStore(onComplete) {
  const sagaMiddleware = createSagaMiddleware({ sagaMonitor });

  const store = Reactotron.createStore(reducers, {}, compose(
    applyMiddleware(sagaMiddleware, thunk, googleAnalytics),
  ));
  sagaMiddleware.run(rootSaga);

  if (isDebuggingInChrome) {
    window.store = store;
  }
  setTimeout(() => {
    onComplete(store.getState());
  });

  return store;
}

// Setup.js
class Setup extends Component {
  constructor() {
    super();
    GoogleAnalytics.setTrackerId('UA-86299762-1');
    this.state = {
      isLoading: true,
      store: configureStore((state) => {
        this.setState({ isLoading: false });
        if (state.user.nickname) {
          const { nickname, school } = state.user;
          GoogleAnalytics.setUser(nickname);
          setCrashlytics(nickname, school);
        }
      }),
    };
    // console.disableYellowBox = true;
  }

  render() {
    if (this.state.isLoading) {
      return <LoadingScreen />;
    }
    return (
      <Provider store={this.state.store}>
        <App />
      </Provider>
    );
  }
}

RN version: 0.38 reactotron-react-native: 1.6.0 reactotron-redux: 1.6.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
MichaelITcommented, Sep 8, 2017

I fixed this flow the document https://github.com/infinitered/reactotron/blob/master/docs/plugin-redux.md

Then, where you create your Redux store, instead of using Redux’s createStore, you can use Reactotron’s createStore which has the same interface.

const store = Reactotron.createStore(rootReducer, compose(middleware))
4reactions
ferrobleshcommented, Sep 28, 2017

is there any update for this open item? Already try to move it to componentWillMount but still throwing that error only when Reactotron open. Very weird

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: undefined is not an object (evaluating 'store.getState')
It seems the import statement is not right. It should be: import Store from './src/Store';.
Read more >
undefined is not an object (evaluating 'store.getState') - YouTube
ERROR TypeError: undefined is not an object ( evaluating 'store. getState ')Please do like share and comment if you like the video please...
Read more >
Developers - null is not an object (evaluating 'reduxStore.getState') -
I met this error. When I refresh several times, sometimes it runs. This is my files // reactoron-config.js import Reactotron, { trackGlobalErrors }...
Read more >
Actions and reducers: updating state - Human Redux
Reducers in Redux have a few simple rules: Always return the state, even if you didn't change it, and even if it's just...
Read more >
TypeError: undefined is not an object (evaluating 'store.getState')
Coding example for the question TypeError: undefined is not an object (evaluating 'store.getState')-React Native.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found