infinitered / infinitered/reactotron

undefined is not an object (evaluating _ReactotronConfig.Reactotron.createEnhancer')

Open
#1,218 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.6k
Forks
972
PR merge metrics
No merged PRs in 30d

Description

I can't get reactotron redux to work in my expo project and I don't know what I'm doing wrong. It connects but when I try to apply redux connection it gives me that error. Please help me out as it's been a while I've been trying to get this work.

**ReactotronConfig.js**
```
import Reactotron from "reactotron-react-native";
import AsyncStorage from '@react-native-async-storage/async-storage';
import { reactotronRedux } from 'reactotron-redux'
const reactotron = Reactotron
.setAsyncStorageHandler(AsyncStorage)
.configure({ name: 'React Native Demo' })
.use(reactotronRedux()) // <- here i am!
.connect() //Don't forget about me!

export default reactotron
```

**Store.js**
```
// From reactnative.guide
import { Reactotron } from '../utils/ReactotronConfig';
import { createStore, compose, applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import rootReducer from './reducers/rootReducer';
import { persistStore, persistReducer } from 'redux-persist'
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2'
import { AsyncStorage } from 'react-native';

const persistConfig = {
key: 'root',
storage: AsyncStorage,
stateReconciler: autoMergeLevel2,
blacklist: ['intervalTimer', 'creatingWorkout', 'creatingWorkoutPlan']
}

const persistedReducer = persistReducer(persistConfig, rootReducer)

const enhancerList = [];
const devToolsExtension = window && window.__REDUX_DEVTOOLS_EXTENSION__;

if (typeof devToolsExtension === 'function') {
enhancerList.push(devToolsExtension());
}

const composedEnhancer = compose(applyMiddleware(ReduxThunk), ...enhancerList, Reactotron.createEnhancer());

export const store = createStore(persistedReducer, {}, composedEnhancer

);
export const persistor = persistStore(store);
```

**App.js**
```
// right on top of the page
import '../utils/ReactotronConfig';
// later down in the page
if (__DEV__) {
import("./application/utils/ReactotronConfig").then(() => console.log("Reactotron Configured"));
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ReactotronConfig.js, Store.js, and App.js in the reported Expo setup, then reproduce the error when creating the Redux enhancer. Check how Reactotron is imported and initialized across those files; done means the Redux connection can be applied without the reported undefined-object error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.