Open srmagura opened 2 years ago
Hi @srmagura , I tried reproducing the issue, but couldn't find anything. It would be great if you can provide snack / codesandbox link.
Hi @ankit-tailor, I am also unable to reproduce the compilation error in a snack. If I had to guess, the error was occurring in my project due to some weird interaction between different @types/
packages and the NativeBase types.
If no one else is experiencing this issue, it can be closed.
That said, the way your .d.ts
file lists all of the Input
props from @types/react-native
seems odd / error-prone to me. For example, I don't understand why autoCompleteType
is in your .d.ts
file even though the string "autoCompleteType" does not appear anywhere within the NativeBase repository.
We will try this on our end, the type is coming from @types/react-native
and we have RN version 0.63.2
. I think updating to a newer version will fix your issue and we have this in our roadmap.
I get this error in a newly created project using create-react-app
. Here is what package.json
looks like:
"dependencies": {
"@react-native-community/datetimepicker": "^6.2.0",
"@react-navigation/bottom-tabs": "^6.3.2",
"@react-navigation/elements": "^1.3.4",
"@react-navigation/native": "^6.0.11",
"@react-navigation/stack": "^6.2.2",
"expo": "^45.0.0",
"native-base": "^3.4.8",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-hook-form": "^7.33.1",
"react-native": "0.68.2",
"react-native-gesture-handler": "~2.2.1",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native-safe-area-context": "4.2.4",
"react-native-screens": "~3.11.1",
"react-native-svg": "^12.3.0",
"react-native-web": "0.17.7"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@expo/ngrok": "^4.1.0",
"@types/react": "~17.0.21",
"@types/react-native": "~0.67.6",
"typescript": "~4.3.5"
},
@ankit-tailor I'm seeing this issue as well, with v3.4.11. autoCompleteType
is present in the file node_modules/native-base/lib/typescript/components/primitives/TextArea/index.d.ts
(installed from npm
). I assume this is auto-generated by your build step somehow, as autoCompleteType
has to be pulled in from somewhere else.
Any resolution for this?
Description
The TypeScript definitions for
TextArea
still reference theautoCompleteType
prop which was removed from React Native recently.CodeSandbox/Snack link
N/A
Steps to reproduce
native-base
3.4.1 into any project.node_modules/native-base/lib/typescript/components/primitives/TextArea/index.d.ts
.Expected behavior: The
.d.ts
file does not contain any reference toautoCompleteType
, which was removed from React Native in this commit, which was published as part of react-native 0.68.1.Actual behavior: The
.d.ts
file referencesautoCompleteType
. This is causing a TypeScript error in my project.NativeBase Version
3.4.1
Platform
Other Platform
TypeScript issue which applies to all platforms
Additional Information
Here is a prettified version of the .d.ts file for your convenience
```ts import React from "react"; import type { InterfaceInputProps } from "../Input/types"; import type { PlatformProps } from "../../../components/types"; export interface ITextAreaProps extends Omit< InterfaceInputProps, "_web" | "_android" | "_ios" | "_light" | "_dark" | "_important" >, PlatformProps