-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix exported types so that they work for react-redux #61
Comments
thanks @marqu3z! I'll look into this as soon as I can. I might cut a beta release—would you be willing to test that? |
@chrisbolin We may be able to retain support as it was before but satisfy typings like these by using: |
Sure, no problem |
see #62 as well. We may be able to use kitten's |
useSelector
Important note: in order to fix the types, we need to give up the naive hope that we could ever types that statically do a comparison. e.g. <Thing = any>(<a: Thing, b: Thing>) => boolean We've dealt with this earlier, so I want to make sure it doesn't come back to bite us. |
@chrisbolin the more I'm reading about namespace declaration, the more it seems our types are definitely broken as-is. With the namespace declaration being dead code, I'm not confident it's working the way we think it is? |
@ryan-roemer this might be closable as well. We may not have had the automation turned on to set this ticket to closed when moving the card on the project board. |
Sounds good! |
It seems the typing for react redux hook
useSelector
relies on the types of the equality function to infer the return type:Using
isEqual
as equality function the compiler will inferany
asTSelected
type because:So
Declaring
isEqual
with generic types should solve the issueThe text was updated successfully, but these errors were encountered: