我如何添加堆栈跟踪到我当前的Redux Devtools设置?



这是我当前的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属性这样的东西,而不完全重写我的变量赋值来匹配他们。

您是否尝试过将选项设置为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),
)
);

相关内容

  • 没有找到相关文章

最新更新