Closed SebastienGllmt closed 3 years ago
I will look into it. I don't remember changing the structure of the enhancer, so I am guessing this is caused by incorrect typing that got added when converting it to typescript.
I just published v2.0.5 which should have updated typing for the enhancer. I am new to Typescript however, and had some trouble understanding the Redux types. Please give it a shot and let me know if it now allows you to use it redux-toolkit.
Yep, 2.0.5 no longer gives a type error 👍
Redux Toolkit exposes its own utility function for creating stores called configureStore. When using this function, you need to pass all enhancers in as an array.
The type that Redux Tookit expects is
StoreEnhancer[] | (StoreEnhancer[] => StoreEnhancer[])
This worked well with the v1 version of addon-redux. However, the type of
withReduxEnhancer
in v2 now useswhich isn't compatible with Redux Toolkit.
Would be great to see an example of how to setup this library with Redux Toolkit given how prevalent that library is.