-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript: unclear how to appease compose
's typings when using redux dev tools
#1937
Comments
Here's how I do it: import {createStore, applyMiddleware, compose, GenericStoreEnhancer} from 'redux';
const devToolsExtension: GenericStoreEnhancer = window['devToolsExtension'] ?
window['devToolsExtension']() : f => f;
const store = createStore(rootReducer,
compose(
applyMiddleware(sagaMiddleware),
devToolsExtension
) as GenericStoreEnhancer
); Assuming that |
Yep, replacing |
For future reference, this made the trick for me reduxjs/redux-thunk#51 (comment) TLDR: Do not use |
Hi - struggled with this for a while... Found the easiest way for me was to install import { composeWithDevTools } from 'redux-devtools-extension';
const store = createStore(reducer, composeWithDevTools(
applyMiddleware(...middleware),
// other store enhancers if any
)); This replaced my use of This was taken from redux devtools docs. |
Prior to #1868 it was possible to use https://github.com/zalmoxisus/redux-devtools-extension as we do in CRDB: https://github.com/cockroachdb/cockroach/blob/develop/ui/app/redux/state.ts#L27:L51
After #1868, this produces the following error:
I'm not really sure if this is a bug in the typings or if we're doing something wrong in our code, but any help would surely be appreciated.
/cc @aikoven
The text was updated successfully, but these errors were encountered: