callstack / react-native-paper

Material Design for React Native (Android & iOS)
https://reactnativepaper.com
MIT License
12.73k stars 2.07k forks source link

Type script errors #2101

Closed jauggy closed 3 years ago

jauggy commented 4 years ago

Current behaviour

I created a react native app then added typescript then added react-native-paper and added PaperProvider to the index.

Get errors after running

yarn tsc

Sample errors:

node_modules/react-native-paper/lib/typescript/src/components/Badge.d.ts:64:59 - error TS2344: Type '"visible" | "size" | "style" | "ref" | "children" | "key" | "onLayout" | "testID" | "nativeID" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | ... 26 more ... | "textBreakStrategy"' does not satisfy the constraint '"visible" | "size" | "style" | "ref" | "children" | "theme"'.
  Type '"key"' is not assignable to type '"visible" | "size" | "style" | "ref" | "children" | "theme"'.

Expected behaviour

No errors

Code sample

https://github.com/jauggy/ReactNativeDemo

What have you tried

I'm not sure what I should do to fix the problem.

Your Environment

software version
ios or android
react-native 0.63.2
react-native-paper 4.0.1
node
npm or yarn yarn version 1.22.4
expo sdk
github-actions[bot] commented 4 years ago

Couldn't find version numbers for the following packages in the issue:

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

raajnadar commented 4 years ago

Make sure you have latest version of @types/react-native

jauggy commented 4 years ago

I have installed version 0.63.4 which is the latest.

shubhamkes commented 4 years ago

Facing similar issue

contactsimonwilson commented 4 years ago

@jauggy try upgrading @types/react-native from 0.63.4 to 0.63.6 and the issue will be resolved. I have verified the same in your repo.

github-actions[bot] commented 3 years ago

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.