-
-
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
useSelector seems to have no type awareness #1358
Comments
After inspection fo your code I can see its not possible at the moment to make this happen as your lib is written in purejs and you use jsdocs for ide intelisense and you can't make this feature happen with the current language. If im wrong please correct me |
If you're using TypeScript, we don't maintain the types here. Those are on the DefinitelyTyped repo, so check with them for their support resources. |
Thanks I was being silly didn't install @types/react-redux as a dependency. Thanks for pointing me int he right direction |
Anyone gotten this to work for javscript in webstorm? I tried providing the typescript definitions like described in https://www.jetbrains.com/help/webstorm/configuring-javascript-libraries.html#ws_jsconfigure_libraries_ts_definition_files but no luck. |
@olejorgenb after installing |
When making my own selector with typing
const practitionerAvailability = (state): availabilities => state.practitioner.availability.availabilities;
the returned type from useSelector is still type any when i do something like.
const a = useSelector(practitionerAvailability)
.I made a little example in typescript which solves this
Is there any way you guys could include the behaviour baked into the useSelector function. Thanks :)
The text was updated successfully, but these errors were encountered: