2017-10-19 109 views
0

我想爲我的項目使用遠程React Native Debugger。我在我的Mac上安裝了React-Native-Debugger,其中包含$ brew update && brew cask install react-native-debugger。然後,我添加了Remote-redux-devtools包與npm install --save-dev remote-redux-devtoolsReact Native Debugger狀態undefined

我的createStore代碼看起來像這個atm。

import { createStore, applyMiddleware } from 'redux' 
import { composeWithDevTools } from 'remote-redux-devtools' 
import thunk from 'redux-thunk' 
/* some other imports */ 

const composeEnhancers = composeWithDevTools({ realtime: true, port: 8000 }) 
export default createStore(rootReducer, composeEnhancers(
    applyMiddleware(thunk.withExtraArgument(api), logger, firebaseSave) 
)) 

控制檯輸出工作正常,但它沒有采取行動或redux狀態。我錯過了一步嗎?爲什麼它沒有采用REDX?

https://github.com/zalmoxisus/remote-redux-devtools

https://github.com/jhen0409/react-native-debugger

回答

2

添加終極版devtools擴展您的createStore

export default createStore(rootReducer, composeEnhancers(
    applyMiddleware(thunk.withExtraArgument(api), logger, firebaseSave) 
),window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()) 

欲瞭解更多信息:https://github.com/zalmoxisus/redux-devtools-extension

+0

我以爲包是不是意味着陣營母語? – Waltari

+0

請參閱文檔:https://github.com/jhen0409/react-native-debugger/blob/master/docs/redux-devtools-integration.md –