-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[TS2742] The inferred type of '...' cannot be named without a reference to ... #4448
Comments
same here |
emm, don't export |
Related to #3962. |
It seems like in your case we have to export the Side note: It seems like if a type is exported from an internal But if that same type is not exported at all the error message becomes much clearer like this: |
@aryaemami59 that makes sense, thanks. i think we wouldn't be against exporting CaseReducerDefinition - in fact my open PR https://github.com/reduxjs/redux-toolkit/pull/3894/files#diff-5278ccae8e99ae0373490ef372d1953e0f3da303d948485ef7e00bd7de7fffa3 exports more that we can export just in case. |
@EskiMojo14 Wonderful, I have a list of types that need to be exported, thankfully they're not that many (as of now, might add more to the list if I discover more problems), will hopefully put up a PR soon for a partial fix. |
- This should serve as a partial fix for reduxjs#3962, reduxjs#4448, reduxjs#3983, reduxjs#4066, reduxjs#4108, reduxjs#4401 - Here is the list of the problematic (now exported) types: From `@reduxjs/toolkit`: - `CombinedSliceReducer` - `CaseReducerDefinition` - `Id` renamed to `TSHelpersId` - `UncheckedIndexedAccess` - `ReducerWithInitialState` - `CaseReducerDefinition` - `Id` renamed to `TSHelpersId` - `UncheckedIndexedAccess` - `ReducerWithInitialState` From `@reduxjs/toolkit/query/react`: - `UseLazyQuery` - `UseQuery` - `QueryHooks`
Can you run this command and try again to see if it fixes the issue: pnpm add https://pkg.csb.dev/reduxjs/redux-toolkit/commit/06a30ee4/@reduxjs/toolkit |
It did fix the issue for me. Thank you. |
for me adding |
It is not working if I try to export reducers/slices from a package.
Is this an actual TS issue?
Here's a possible reproduction
The text was updated successfully, but these errors were encountered: