Reactjs 无法在ubuntu上的reactotron中订阅react-redux状态
我想将reactotron添加到我的react redux应用程序中-我正在使用rematch redux插件。Redux工作正常,我还可以连接到reactotron桌面应用程序, 但我不能订阅任何州。当我想订阅它时,什么都不会发生 只有副标题: “没有订阅。您可以通过按ctrl+n来订阅redux存储中的状态 在reactotron应用程序的时间轴上,我可以看到我与以下详细信息的连接:Reactjs 无法在ubuntu上的reactotron中订阅react-redux状态,reactjs,redux,reactotron,rematch,Reactjs,Redux,Reactotron,Rematch,我想将reactotron添加到我的react redux应用程序中-我正在使用rematch redux插件。Redux工作正常,我还可以连接到reactotron桌面应用程序, 但我不能订阅任何州。当我想订阅它时,什么都不会发生 只有副标题: “没有订阅。您可以通过按ctrl+n来订阅redux存储中的状态 在reactotron应用程序的时间轴上,我可以看到我与以下详细信息的连接: environment undefined reactotronLibraryName reactotron
environment undefined
reactotronLibraryName reactotron-react-js
reactotronLibraryVersion 2.1.1
platform browser
platformVersion Linux x86_64
userAgent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
screenWidth 1920
screenHeight 1080
screenScale 1
windowWidth 1853
windowHeight 951
name FoodGlobal
clientId 6f463c04-0d7a-8786-112b-53a630036930
reactotronCoreClientVersion 2.8.2
address ::ffff:192.168.0.59
这是我的reactotron配置:
import Reactotron from 'reactotron-react-js';
import {reactotronRedux} from 'reactotron-redux';
const reactotron = Reactotron.configure({
name: 'FoodGlobal',
host: '127.0.0.1'
})
.use(reactotronRedux());
reactotron.connect();
export default reactotron;
这里是redux存储配置:
import thunk from "redux-thunk";
import selectPlugin from "@rematch/select";
import { init } from "@rematch/core";
import * as models from "./models";
import reactotron from './reactotron';
export const store = init({
models,
redux: {
createStore: reactotron.createStore,
middlewares: [thunk]
},
plugins: [selectPlugin()]
});
export const { dispatch } = store;
export default store;
谢谢您的帮助。您可以按enter键而不必键入任何内容,它将订阅状态。如果这不起作用,则遵循以下步骤 reactoronconfig.js
import { AsyncStorage } from 'react-native';
import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';
const reactotron = Reactotron.setAsyncStorageHandler(AsyncStorage)
.configure() // controls connection & communication settings
.use(reactotronRedux())
.use(sagaPlugin())
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
import Reactotron from '../../ReactotronConfig';
const sagaMonitor = Reactotron.createSagaMonitor();
const sagaMiddleware = createSagaMiddleware({ sagaMonitor });
const store = createStore(rootReducer, compose(...enhancers, Reactotron.createEnhancer()));
cretaeStore.ts
import { AsyncStorage } from 'react-native';
import Reactotron from 'reactotron-react-native';
import { reactotronRedux } from 'reactotron-redux';
import sagaPlugin from 'reactotron-redux-saga';
const reactotron = Reactotron.setAsyncStorageHandler(AsyncStorage)
.configure() // controls connection & communication settings
.use(reactotronRedux())
.use(sagaPlugin())
.useReactNative() // add all built-in react native plugins
.connect(); // let's connect!
import Reactotron from '../../ReactotronConfig';
const sagaMonitor = Reactotron.createSagaMonitor();
const sagaMiddleware = createSagaMiddleware({ sagaMonitor });
const store = createStore(rootReducer, compose(...enhancers, Reactotron.createEnhancer()));
上面的代码来自我的文件,但您的配置似乎没有什么不同。
请遵循以下两个步骤