Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript error when upgrading to react-redux 8.0.0

See original GitHub issue

What 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?


Did this work in previous versions of React Redux?

  • Yes

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found