null is not an object (evaluating 'reduxStore.getState')
See original GitHub issue
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:
- Created 7 years ago
- Reactions:5
- Comments:23 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I fixed this flow the document https://github.com/infinitered/reactotron/blob/master/docs/plugin-redux.md
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