fix: Default export of the module has or is using private name type error when using latest alpha/beta #3605
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #3455
Version: 2.0.0-beta.0
The
reducerDefinitionType
symbol type causes TypeScript issues for consumers ofcreateSlice
who have the following included in theirtsconfig.json
settings:The TypeScript error appears as...
Simply ensuring that
reducerDefinitionType
is exported and publicly accessible does not remove the error (could be an issue with the TypeScript compiler?). Hopefully someone knows how to correctly export thisunique symbol
or confirm that it is impossible.Right now, the fix uses the underscore (
_
) prefix naming convention for thereducerDefinitionType
to avoid symbols (although certainly not as unique as what I think is preferred).Maybe having a separate object that tracks the reducer definition types on a slice can work better?
PR additionally resolves other "not portable" TypeScript errors by exporting the needed types.
Hope this helps you guys.