-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Possible regression with ConnectedProps and React.ComponentProps<typeof ...> in 8.x #1955
Comments
Huh. I certainly haven't seen that message before. Uh.... summoning @phryneas and @Andarist HALP WAT THIS MEAN (fwiw this is going to be pretty low priority for us to look at, given that we generally recommend using the hooks API instead of |
I could for a second reproduce this with the React 16 types, but then it was gone and just working. I guess this is some edge case with old React types? Generally: you are using React 16 - is there any practical reason why you are updating React-Redux first? Generally I would probably update the rest of the stack first/at the same time. |
I understand. We have about 15 repositories with over 100 components still using
For a bit of context, we can't easily update to React 17+ at the moment because the decision was made to use Enzyme for unit testing about 4 years ago. Enzyme doesn't officially support React 17/18 and with several thousand unit tests it's still a bit of work till we've completely migrated to React Testing Library. The reason I ran into this is because we use Renovate to automatically update dependencies, I checked the changelog and it mentioned React-Redux v8 is still compatible with all versions of React that have hooks so I gave it a go. Everything else is as up-to-date as possible with the limitation we have on the React version. |
What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
What is the current behavior?
The following simplified snippet throws a
TS2312
error after upgrading to react-redux v8.There seem to be no apparent changes to the definition of
ConnectedProps
between@types/react-redux
andreact-redux
so I'm not sure what could be causing this.The changelog does mention changes to the types for
connect
where it no longer has theDefaultRootState
included. But even changing the definition ofconnector
in the example above to include a generic withany
,{}
or the actual global state interface does not resolve the issue.What is the expected behavior?
It's still possible to use
React.ComponentProps<typeof ...>
like when usingreact-redux@7.2.8
with@types/react-redux@7.1.24
Which browser and OS are affected by this issue?
N/A
Did this work in previous versions of React Redux?
The text was updated successfully, but these errors were encountered: