Closed royjkim closed 7 years ago
It works, you can check it with our counter example. It applies redux-thunk
middleware and dispatch
works.
The problem could be that you're importing composeWithDevTools
not as:
import { composeWithDevTools } from 'remote-redux-devtools';
but
import composeWithDevTools from 'remote-redux-devtools';
So, you're getting the store enhancer instead.
@zalmoxisus Thanks to your quick answer. I already understood what you want to tell me.
composeWithDevTools
and { composeWithDevTools }
.Anyway, like I said I just want to know the exact reason. (because 'remote-redux-devtools' is cool !). I'll try more things on another projects.
Also having this issue but only without { realtime: true }
With {realtime: true}
I get SocketProtocolError: Socket hung up
I had it working with the basic enhancer but it would only work 1 out of 3 requests. I guess there's a race condition or something.
I want to know the reason why 'remote-redux-devtools' can't work with 'redux-thunk'.
1-1. When I use 'remote-redux-devtools' with 'redux-thunk', I can't use 'dispatch'.
const composeEnhancers = composeWithDevTools({ realtime: true })
const store = createStore(reducer, composeEnhancers(
applyMiddleware(thunk)
))
1-2. When I use 'remote-redux-devtools' like below, it looks like 'compose()' doesn't work.
const store = createStore(reducer, composeWithDevTools(
applyMiddleware(thunk)
))
When I use 'redux-logger' instead of 'remote-redux-devtools', it works fine.
const logger = createLogger()
const store = createStore(reducer, compose(
applyMiddleware(
thunk,
logger
)
))
package "react": "15.4.2", "react-native": "0.40.0", "react-redux": "^5.0.3", "redux": "^3.6.0", "redux-logger": "^2.8.2", "redux-thunk": "^2.2.0"
"remote-redux-devtools": "^0.5.7"