infinitered / reactotron

A desktop app for inspecting your React JS and React Native projects. macOS, Linux, and Windows.
https://docs.infinite.red/reactotron/
MIT License
14.94k stars 945 forks source link

State keeps showing "No Subscriptions" (been week of googling) #1216

Open HosAkh opened 3 years ago

HosAkh commented 3 years ago

I'm using expo (idk if that matters but seems like it shouldn't from searching around).

I went into my state and have done both * and empty state and just press enter image

Afterwards, nothing still shows up in my State tab.

image

As you can see at the bottom I'm connected to my simulator.

Here is my store.js and ReactotronConfig.js page.

Store.js

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';

let storeEnhancers = [];

if (__DEV__) {
  const reactotron = require("../utils/ReactotronConfig").default;
  reactotron.initiate();
  storeEnhancers = [...storeEnhancers, reactotron.createEnhancer()];
}

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);

export const store = createStore(persistedReducer, {}, composedEnhancer, {
  enhancers: [...storeEnhancers],
});
export const persistor = persistStore(store);

ReactotronConfig.js

import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux'

const reactotronConfig = {
    initiate: () => {
        Reactotron.configure()
            .useReactNative({
                storybook: true
            })
            .use(reactotronRedux())
            .connect();
    },
    createEnhancer: () => Reactotron.createEnhancer()
};

export default reactotronConfig;
thorecaspersen commented 3 years ago

I have same problem :(

Novsochetra commented 3 years ago

I have same problem also. 😢

thorecaspersen commented 3 years ago

Hi guys, it work for me when I filled patch input field with nothing and just click enter. would be nice to have a help text about that :)

pelaxa commented 3 years ago

anyone figure this out? @thorecaspersen what/where is "patch input field"

akshaychilad commented 2 years ago

Issue still exists but sometimes (Very rarely) it is auto connected with reducer. Unable to repro

ranaalisaeed commented 2 years ago

any solution?

anggaggaH commented 2 years ago

is anyone resolved this?

StephanDeUdemy commented 2 years ago

Like thorecaspersen, it worked for me this way : State > Subscriptions. Press Ctrl+n, enter '' in PATH and press enter. then you see the root of your state, which for me is called 'value'.

StephanDeUdemy commented 2 years ago

ReactotronConfig.js import Reactotron from 'reactotron-react-native'; // import sagaPlugin from 'reactotron-redux-saga'; import AsyncStorage from '@react-native-async-storage/async-storage'; import {reactotronRedux} from 'reactotron-redux';

const reactotron = Reactotron.configure({ name: 'OxyMoov', }) .setAsyncStorageHandler(AsyncStorage) .useReactNative() // .use(sagaPlugin()) .use(reactotronRedux()) // <- here i am! .connect();

export default reactotron;

StephanDeUdemy commented 2 years ago

Reducer.ts import reactotron from '../src/config/ReactotronConfig'; // import reactotronConfig from "../src/config/ReactotronConfig";

export function initializeStorage() { // ---------------------------------------------------------------------------------------- Alban Juillet 2022 // const persistConfig = { // key: 'root', // storage: AsyncStorage, // blacklist: ['value.loginPage.isLoading'] // navigation will not be persisted // };

// const persistedReducer = persistCombineReducers(persistConfig, {
//     loginPage: loginReducer,
//     settings: settingsReducer,
//     tilesReel: rTiles,
//     tilesPlanning: pTiles,
// });

// ---------------------------------------------------------------------------------------- modifs 2022.09.21
const rootReducer = combineReducers({
    auth: loginReducer,
    settings: settingsReducer,
    tilesReel: rTiles,
    tilesPlanning: pTiles,
});

const persistConfig = getPersistConfig({
    key: 'root',
    storage: AsyncStorage, // whatever storage you use
    blacklist: ['auth.isLoading', 'settings.isLoading', 'tilesReel.tiles.isLoading', 'tilesReel.members.isLoading', 'tilesReel.weeks.isLoading' ],
    rootReducer, // your root reducer must be also passed here
    // ... // any other props from original redux-persist config omitting the state reconciler
});

const persistedReducer = persistReducer(persistConfig, rootReducer);

// ----------------------------------------------------------------------------------------

const reactotronEnhancer =  reactotron.createEnhancer != null ? reactotron.createEnhancer() : null;

const store =  configureStore({
    reducer: persistedReducer,
    enhancers: reactotronEnhancer != null ? [reactotronEnhancer] : undefined,
    middleware: (getDefaultMiddleware) =>
        getDefaultMiddleware({
            serializableCheck: {
                ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
                ignoredActionPaths: ['action.payload', 'payload'],
            },
        })
    ,
});

const persistor = persistStore(store);
return { store, persistor };

}

export const { store, persistor } = initializeStorage();