Closed VuongVu closed 4 years ago
From that code example, I can only guess that you have two different versions of redux installed that might have conflicting definitions of the StoreEnhancer
type.
You can find that out by running yarn why redux
.
I could only tell you more if you could provide me with a CodeSandbox or similar with a runnable reproduction.
As a quick fix, you could also replace
const store = configureStore({
reducer: createReducer(),
preloadedState: initialState,
middleware,
- enhancers,
+ enhancers: enhancers as any,
});
but of course you'd lose type checks for that line.
yep, thank you for your support. I reinstalled redux with the same version with redux-toolkit but it not work. I will detect it later when I have more free time.
I have an error with enhancers, it says:
Type 'StoreEnhancer<{}, {}>[]' is not assignable to type 'StoreEnhancer<{}, {}>[] | ConfigureEnhancersCallback | undefined'.
My code is written in Typescript:
My configureStore:
And reducers:
Plz tell me what am i doing wrong or give me a solution. Thank you.