如果您使用redux-devtools-extension,您可以通过以下方式轻松配置您的商店:import { createStore, applyMiddleware } from 'redux';import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';const composeEnhancers = composeWithDevTools({ // options like actionSanitizer, stateSanitizer});const store = createStore(reducer, /* preloadedState, */ composeEnhancers( applyMiddleware(...middleware), // other store enhancers if any));开发工具中的记录器将在生产中禁用。代替developmentOnly,您可以添加logOnlyInProduction以查看生产中的日志。