0

这是我当前的 redux 商店分配:

import { composeWithDevTools } from 'redux-devtools-extension';
import { createStore, applyMiddleware } from 'redux';
import { PersistGate } from 'redux-persist/integration/react';
import reduxThunk from 'redux-thunk';

const persistedReducer = persistReducer(persistConfig, reducers);

const store = createStore(
  persistedReducer,
  composeWithDevTools(applyMiddleware(reduxThunk)),
);

我希望能够使用Redux Devtools在我的项目中进行堆栈跟踪。给出的示例与我的设置并不真正匹配,只是想知道如何在trace不完全重写我的变量分配以匹配他们的情况下添加类似属性的内容。

4

1 回答 1

0

您是否尝试过将选项设置为composeWithDevTools然后将其放入createStore

import { createStore, applyMiddleware } from 'redux';
import { composeWithDevTools } from 'redux-devtools-extension';

const composeEnhancers = composeWithDevTools({trace: true}); // <<< set options here

const store = createStore(
  reducer, /* preloadedState, */
  composeEnhancers( // <<< use it here
    applyMiddleware(...middleware),
  )
);

于 2021-11-11T23:38:20.967 回答