-
Notifications
You must be signed in to change notification settings - Fork 674
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
Combiner function arguments have unknown type #627
Comments
You must provide correctly typed arguments for all of the input functions. As of Reselect 4.1, Reselect infers everything from those arguments. Define |
I do not understand why, with the new typings of |
It's not about the "inline" or "defined separately". It's literally that you must tell Reselect what the types of the arguments are. // ❌ FAILS - no type for `state`
createSelector(
(state) => state.x,
output
)
// ✅ WORKS - TS knows the type of `state`
createSelector(
(state: RootState) => state.x,
output
) Reselect's types now infer everything from those arguments, and tbh I'm not sure how this ever would have worked even with the old types if you don't provide any argument types at all. |
Thank you for clarifications @markerikson , it seems to work correctly now with declared types of arguments. 🎉 |
Hi! Sorry if this was asked before. The closest issue I found was #547 and #559, if this one is a duplicate, feel free to close it.
Since we updated from 3.x to 4.1.8, we got a lot of errors with combiner function arguments getting typed as
any
.I created a small playground to reproduce the issue here:
Is this the intended behavior of reselect typings?
The text was updated successfully, but these errors were encountered: