You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempt to fix by directly exporting $CombinedState #4029
What is the current behavior?
When typescript is upgraded to the latest version 4.2.x the output of combineReducers throws an error.
Steps to Reproduce
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://codesandbox.io or similar.
Typescript should run, and emit error Default export of the module has or is using private name '$CombinedState'
What should Redux be doing?
Exporting the result of combineReducers should not be a typescript error.
Environment Details
To my knowledge, all versions of Redux with Typescript declarations are impacted.
More importantly, this change happens on the latest 4.2.x versions of Typescript.
The text was updated successfully, but these errors were encountered:
My first question is, why are you exporting it with an empty generic and an empty object? Does this happen with "normal" usage, ie, something like combineReducers({counter: counterReducer})?
Also, if something about TS 4.2 changed how it's interpreting the types... I'd like to know what about TS 4.2 changed so that we know why this is suddenly causing an error.
Updated error branch to give examples of failure with actual map.
For some reason createStore is required to trigger the issue
I too would like to know what the Typescript change is, but cannot easily find a related commit.
This type of error is not new to Typescript though: microsoft/TypeScript#6307
Prior Issues
Attempt to fix by directly exporting $CombinedState #4029
What is the current behavior?
When typescript is upgraded to the latest version 4.2.x the output of
combineReducers
throws an error.Steps to Reproduce
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://codesandbox.io or similar.
What is the expected behavior?
See minimal reproducible error here: #4029
Checkout branch https://github.com/JacobLey/redux/tree/combinedStateRepro, run
cd ./error && npm start
Typescript should run, and emit error
Default export of the module has or is using private name '$CombinedState'
What should Redux be doing?
Exporting the result of
combineReducers
should not be a typescript error.Environment Details
To my knowledge, all versions of Redux with Typescript declarations are impacted.
More importantly, this change happens on the latest 4.2.x versions of Typescript.
The text was updated successfully, but these errors were encountered: