Open iutin opened 4 years ago
In case anyone needs: it happened to me aswell.
In my case, I was missing these changes in my ReactotronConfig
file:
+ import { reactotronRedux } from 'reactotron-redux';
const tron = Reactotron.configure()
.useReactNative()
+ .use(reactotronRedux())
.setAsyncStorageHandler(AsyncStorage)
.connect();
+ export default tron;
It seems that use(reactotronRedux())
adds a createEnhancer
function on Reactotron
.
I have this issue... TypeError: _reactotronReactNative.default.createEnhancer is not a function. (In '_reactotronReactNative.default.createEnhancer()', '_reactotronReactNative.default.createEnhancer' is undefined)
"reactotron-react-native": "3.6.5", "reactotron-redux": "3.1.2",
My code: `
import { createStore, combineReducers } from 'redux'; import Reactotron from 'reactotron-react-native'; import reducer from './reducers/RootReducer'; const mainReducer = combineReducers({ root: reducer, }); export default () => createStore(mainReducer, Reactotron.createEnhancer());
` Does someone have any suggestions? Thanks!
you must not import it from "import Reactotron from 'reactotron-react-native';" but rather " import reactotron from '../../ReactotronConfig';" --> config file which you have created
Thanks @Alirez14 you saved my day
I'm still facing the same issue only on on DEV environment
TypeError: reactotron.createEnhancer is not a function (it is undefined), js engine: hermes
redux store:
import ReduxThunk, {withExtraArgument} from 'redux-thunk';
import {persistReducer, persistStore} from 'redux-persist';
import rootReducer from './combineReducers';
import AsyncStorage from '@react-native-async-storage/async-storage';
const rootPersistConfig = {
key: 'root',
storage: AsyncStorage,
whitelist: ['persistorReducer'],
};
const persistedReducer = persistReducer(rootPersistConfig, rootReducer);
const middlewareEnhancer = applyMiddleware(withExtraArgument(ReduxThunk));
let enhancers;
if (__DEV__) {
const reactotron = require('../../../ReactotronConfig');
enhancers = compose(middlewareEnhancer, reactotron.createEnhancer());
} else {
enhancers = compose(middlewareEnhancer);
}
export const store = createStore(persistedReducer, enhancers);
export const persistor = persistStore(store);
Reactotron config:
import {reactotronRedux} from 'reactotron-redux';
import AsyncStorage from '@react-native-async-storage/async-storage';
console.tron = Reactotron;
const reactotron = Reactotron.setAsyncStorageHandler(AsyncStorage)
.configure() // controls connection & communication settings
.use(reactotronRedux(), networking())
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
export default reactotron;
I'm still facing the same issue only on on DEV environment
TypeError: reactotron.createEnhancer is not a function (it is undefined), js engine: hermes
redux store:
import ReduxThunk, {withExtraArgument} from 'redux-thunk'; import {persistReducer, persistStore} from 'redux-persist'; import rootReducer from './combineReducers'; import AsyncStorage from '@react-native-async-storage/async-storage'; const rootPersistConfig = { key: 'root', storage: AsyncStorage, whitelist: ['persistorReducer'], }; const persistedReducer = persistReducer(rootPersistConfig, rootReducer); const middlewareEnhancer = applyMiddleware(withExtraArgument(ReduxThunk)); let enhancers; if (__DEV__) { const reactotron = require('../../../ReactotronConfig'); enhancers = compose(middlewareEnhancer, reactotron.createEnhancer()); } else { enhancers = compose(middlewareEnhancer); } export const store = createStore(persistedReducer, enhancers); export const persistor = persistStore(store);
Reactotron config:
import {reactotronRedux} from 'reactotron-redux'; import AsyncStorage from '@react-native-async-storage/async-storage'; console.tron = Reactotron; const reactotron = Reactotron.setAsyncStorageHandler(AsyncStorage) .configure() // controls connection & communication settings .use(reactotronRedux(), networking()) .useReactNative() // add all built-in react native plugins .connect(); // let's connect! export default reactotron;
My issue got resolved after replacing
const reactotron = require('../../../ReactotronConfig')
with
const reactotron = require('../../../ReactotronConfig').default;
I have this issue... TypeError: _reactotronReactNative.default.createEnhancer is not a function. (In '_reactotronReactNative.default.createEnhancer()', '_reactotronReactNative.default.createEnhancer' is undefined)
"reactotron-react-native": "3.6.5", "reactotron-redux": "3.1.2",
My code: `
` Does someone have any suggestions? Thanks!