Kel*_*vin 2 react-native redux react-native-debugger
React Native Debugger应用程序版本:v0.8.1
React Native版本:0.57.3
我收到此错误
It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function
Run Code Online (Sandbox Code Playgroud)
在我从0.55更新之前,它一直在工作。
这就是我创建商店的方式。
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducers from '../reducers';
const store = createStore(
reducers,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
compose(applyMiddleware(thunk)),
);
export default store;
Run Code Online (Sandbox Code Playgroud)
使用Chrome进行调试时,效果很好。
请帮忙,谢谢
小智 10
无需将三个参数传递给createStore函数,您需要传递两个参数(其中一个用于预加载状态,此处未使用某些参数)。为了解决这个问题,在仍然使用redux开发工具的同时,您需要将开发工具用作作曲者本身:
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import reducers from '../reducers';
const composeEnhancer = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
reducers,
composeEnhancer(applyMiddleware(thunk)),
);
export default store;
Run Code Online (Sandbox Code Playgroud)
在深入研究redux库,调试器应用程序和dev工具的源代码之后,我意识到这是解决方案,并找到以下部分:https : //github.com/zalmoxisus/redux-devtools-extension#12-advanced-store -设定
我还在github上看到了几乎相同的问题,我认为是您的,但是我想我会在这里再次发布答案,以防万一有人在这里看到它。
希望这可以帮助!
| 归档时间: |
|
| 查看次数: |
1162 次 |
| 最近记录: |