Skip to content
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

Type error on enhancer #17

Closed
Brandon-Perry opened this issue Nov 21, 2024 · 1 comment
Closed

Type error on enhancer #17

Brandon-Perry opened this issue Nov 21, 2024 · 1 comment

Comments

@Brandon-Perry
Copy link

I followed the instructions to add this and got this type error on the enhancer prop in configureStore. I can confirm the devtool works however, so this isn't a breaking issue. I'm using the latest version of expo. Let me know if there's any other info that's useful.

Type '(getDefaultEnhancers: GetDefaultEnhancers<import("/Users/me/client/node_modules/@reduxjs/toolkit/dist/index").Tuple<[import("node_modules/@reduxjs/toolkit/dist/index").ListenerMiddleware<unknown, import("/Users/...' is not assignable to type '(getDefaultEnhancers: GetDefaultEnhancers<import("/node_modules/@reduxjs/toolkit/dist/index").Tuple<[import("node_modules/@reduxjs/toolkit/dist/index").ListenerMiddleware<unknown, import(...'. Two different types with this name exist, but they are unrelated.
  Type 'Tuple<[StoreEnhancer<...>, StoreEnhancer]>' is not assignable to type 'Tuple<Enhancers>'.
    Type '[StoreEnhancer<...>, StoreEnhancer]' is not assignable to type 'Enhancers'.
      Type 'StoreEnhancer<...> | StoreEnhancer' is not assignable to type 'StoreEnhancer'.
        Type 'import("/node_modules/redux/index").StoreEnhancer' is not assignable to type 'import("node_modules/@reduxjs/toolkit/node_modules/redux/dist/redux").StoreEnhancer'.
          Types of parameters 'next' and 'next' are incompatible.
            Types of parameters 'reducer' and 'reducer' are incompatible.
              Type 'Reducer<S, A>' is not assignable to type 'Reducer<S, A, PreloadedState<S>>'.
                Types of parameters 'state' and 'state' are incompatible.
                  Type 'S | PreloadedState<S> | undefined' is not assignable to type 'S | undefined'.
                    Type 'PreloadedState<S>' is not assignable to type 'S | undefined'.
                      Type '(S extends CombinedState<infer S1> ? { [K in keyof S1]?: (S1[K] extends object ? PreloadedState<S1[K]> : S1[K]) | undefined; } : S) | { [K in keyof S]: S[K] extends string | ... 2 more ... | symbol ? S[K] : PreloadedState<...>; }' is not assignable to type 'S | undefined'.
                        Type 'S extends CombinedState<infer S1> ? { [K in keyof S1]?: (S1[K] extends object ? PreloadedState<S1[K]> : S1[K]) | undefined; } : S' is not assignable to type 'S | undefined'.
                          Type 'S | {}' is not assignable to type 'S | undefined'.
                            Type '{}' is not assignable to type 'S'.
                              'S' could be instantiated with an arbitrary type which could be unrelated to '{}'.ts(2719)
index.d.ts(570, 5): The expected type comes from property 'enhancers' which is declared here on type 'ConfigureStoreOptions<{ splash: SplashState; }, UnknownAction, Tuple<[ListenerMiddleware<unknown, ThunkDispatch<unknown, unknown, UnknownAction>, unknown>, ThunkMiddleware<...>]>, Tuple<...>, { ...; }>'
(property) ConfigureStoreOptions<{ splash: SplashState; }, UnknownAction, Tuple<[ThunkMiddleware<{ splash: SplashState; }, UnknownAction>]>, Tuple<...>, { ...; }>.enhancers?: ((getDefaultEnhancers: GetDefaultEnhancers<Tuple<[ThunkMiddleware<{
    splash: SplashState;
}, UnknownAction>]>>) => Tuple<...>) | undefined


@matt-oakes
Copy link
Owner

Duplicate of #12

@matt-oakes matt-oakes marked this as a duplicate of #12 Nov 22, 2024
@matt-oakes matt-oakes closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants