TypeScript error when upgrading to react-redux 8.0.0
See original GitHub issueWhat version of React, ReactDOM/React Native, Redux, and React Redux are you using?
- React: 16.14.0
- ReactDOM/React Native: 16.14.0
- Redux: 4.2.0
- React Redux: 8.0.0
What is the current behavior?
When compiling a TypeScript project that has the noImplicitAny
config set to true
, then react-redux .ts
files are typechecked and result in a compilation error
node_modules/react-redux/src/utils/Subscription.ts:95:8 - error TS7011: Function expression, which lacks return-type annotation, implicitly has an 'any[]' return type.
95 get: () => [],
~~~~~~~~
Found 1 error in node_modules/react-redux/src/utils/Subscription.ts:95
I believe the ts
files should be stripped from the final bundle that is uploaded to npm in order to avoid such ts config mismatch.
What is the expected behavior?
There shouldn’t be any compilation error.
Which browser and OS are affected by this issue?
N/A
Did this work in previous versions of React Redux?
- Yes
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Type errors after upgrading to 1.8.1 and Redux 8 ... - GitHub
I'm working on migrating a codebase from React 17 to 18, react-redux 7.2.0 to 8.0.1 and ... I get this error: Argument of...
Read more >React 18, React Redux 8, and TypeScript: What you need to ...
The goal here is to see what upgrading the React Redux version in an application does to it — we want to look...
Read more >react-redux upgrading to version 8 - Stack Overflow
I upgrade my react app to version 18 then i upgrade react-redux from 7.2.0 to version 8. after that i got this error:....
Read more >react-redux - npm
Start using react-redux in your project by running `npm i react-redux`. ... TypeScript icon, indicating that this package has built-in type ...
Read more >Issues compiling typescript project with Typescript 4, React
I was previously compiling mdb-react-ui-kit (sourced from npm) with typescript 4, React 18, Webpack5 successfully. All the type definitions ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Live in https://github.com/reduxjs/react-redux/releases/tag/v8.0.1 .
PR to fix here: https://github.com/reduxjs/react-redux/pull/1910