React Native with Typescript - void has no call signature
See original GitHub issue🐛 Bug report
Current Behavior
I cannot chain the handleChange
function and call it again because the types say that it may return void, this is also giving me that error when trying to put that function in my input’s onChangeText method
Expected behavior
handleChange
is always returning a function so it shouldn’t have void
in its return types
Reproducible example
I got this error while using the useFormik
hook with React Native and using the handleChange method provided by the useFormik
hook
Your environment
Software | Version(s) |
---|---|
Formik | 2.0.1-rc.13 |
React | 16.9.0 |
React Native | 0.60.5 |
TypeScript | 3.6.3 |
Browser | Chrome |
npm/Yarn | Yarn 1.17.3 |
Operating System | Mac OS |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:5
Top Results From Across the Web
Typescript react context + Type '{}' has no call signatures
Error This expression is not callable. Type '{}' has no call signatures. Toast Hook <button onClick={() => { return ...
Read more >this expression is not callable. type 'never' has no call ...
React component in TypeScript if passed as parameter and assigned to variable; TS2604: JSX element type does not have any construct or call...
Read more >TypeScript Error "element type does not have any construct or ...
Hello all, I am new to react and typescript and I am getting an error ... TypeScript Error "element type does not have...
Read more >typescript-cheatsheet - GitHub Pages
If no types are declared, TypeScript will automatically assign a type depending on ... A great comparison and example for abstract classes is...
Read more >This expression is not callable. Type 'Thunk<Collections ...
Type 'Thunk<Collections, undefined, any, {}, any>' has no call signatures · Nested map in Typescript and React return error this expression is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Up ! Is there any news on this ?
the workaround suggested by @PawelJ-PL works and you can use it to make your own useFormik hook like this: