Typescript error: No overload matches this call.
See original GitHub issueI just init a expo typescript project. Then add ‘react-native-paper’ in my project. When try to use Button component it gives me this typescript error. Do you have any idea why getting error?
Error
No overload matches this call.
Overload 1 of 2, '(props: Pick<Props, "ref" | "style" | "children" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | ... 57 more ... | "contentStyle"> & { ...; }, context?: any): ReactElement<...> | ... 1 more ... | null', gave the following error.
Type '{ children: string; mode: "outlined"; onPress: () => void; }' is missing the following properties from type
Code -
<PaperProvider>
<View >
<Button mode="outlined" onPress={() => {}}>
press me
</Button>
</View>
</PaperProvider>
package.json
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"expo": "~40.0.0",
"expo-status-bar": "~1.0.3",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz",
"react-native-paper": "^4.5.0",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"@types/react": "~16.9.35",
"@types/react-dom": "~16.9.8",
"@types/react-native": "~0.63.2",
"typescript": "~4.0.0"
},
"private": true
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:22
- Comments:35 (1 by maintainers)
Top Results From Across the Web
No overload matches this call. Type 'string' is not assignable to ...
Solution 1: Keep numeric enum signals · Solution 2: Use pure signal string literal types · Solution 3: Change to string enum (no...
Read more >No overload matches this call error in TypeScript | bobbyhadz
The error "No overload matches this call" occurs when we call a function and pass it a parameter that doesn't match any of...
Read more >No overload matches this call with styled components ...
No overload matches this call in TypeScript is really annoying and there aren't too many solutions around there, though we have a solution!...
Read more >How to fix error TS2769 http options no overload matches this ...
This gave me this error in typeScript / Angular: error TS2769: No overload matches this call. Solution. You have to cast httpOptions to...
Read more >"No overload matches this call" typescript error when passing ...
The problem is that Stores is typed as "array needs to contain at least one entry", while stores is typed as "array with...
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 Free
Top 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

Working configuration right now:
There is one easy way to know what should be these versions.
Just pick version of
@types/react-nativefrom https://github.com/callstack/react-native-paper/blob/main/package.jsonHi got the solution. When initializing project using
expo initit automatically added types for react-native project version@types/react-native@0.63.2After upgrading the react-native type version to
@types/react-native@0.63.40It is working fine.