Closed burtek closed 7 months ago
the type of getDefaultEnhancers
depends on the result of your middleware
callback, move the enhancers
key after the middleware
key.
i thought we had documented this somewhere but I can't seem to find it
How the heck do types depend on keys order o.O
Anyway, it worked. Thanks. Would be nice to document that properly :)
We mentioned it in the migration guide:
but not sure it's in the actual docs.
Well, I wasn't migrating, so I never found that part :/ Good to hear it's in at least that place, but I'd expect it somewhere here too: https://redux-toolkit.js.org/api/configureStore#middleware / https://redux-toolkit.js.org/api/configureStore#enhancers
Happy to close this issue unless you want to use it to track any related docs changes
reports TS 2322 error on
middleware
key:This does not happen if the
enhancers
key is not provided:NB: It's not the case of "remove enhancers key since you're not doing anything there" - in my project I do add more enhancers. Here I provided minimal repro code.
Using: