Quantcast
Viewing all articles
Browse latest Browse all 6400

Component cannot be used as a JSX component. Property '$props' is missing in type X but required in type 'ElementClass'

I'm getting this typescript error from basically every component in VSCode, both custom and library components. This is an expo build for react native. This command yields the same results:yarn tsc --project tsconfig.json

here's an example in VSCodeImage may be NSFW.
Clik here to view.
enter image description here

and an example of the full error message:

'KeyboardAvoidingView' cannot be used as a JSX component.  Its instance type 'KeyboardAvoidingView' is not a valid JSX element.    Property '$props' is missing in type 'TimerMixin & KeyboardAvoidingViewComponent' but required in type 'ElementClass'.ts(2786)

This is my .tsconfig:

{"extends": "../../node_modules/expo/tsconfig.base","compilerOptions": {"jsx": "react-native","strict": true  }}

and this is expo's that it extends:

{"$schema": "https://json.schemastore.org/tsconfig","display": "Expo","compilerOptions": {"allowJs": true,"esModuleInterop": true,"jsx": "react-native","lib": ["DOM", "ESNext"],"moduleResolution": "node","noEmit": true,"resolveJsonModule": true,"skipLibCheck": true,"target": "ESNext"  },"exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]}

Viewing all articles
Browse latest Browse all 6400

Trending Articles