'Button' cannot be used as a JSX component

Viewed 407

enter image description here

These ESLint errors happen with components imported from React Native Paper imports since Expo upgrade from SDK 43 to 45. The project is able to run though.

import { Button } from 'react-native-paper';

There seem to be no ESLint errors in the import.

Any ideas?

3 Answers

Add this in package.json

"resolutions": {
    "@types/react": "<version-of-react>"
},

More info here

try wrapping the Button component in fragments like this : <> </>

Have a try by adding a file extension with .jsx or .tsx if using typescript, when creating a component.

Related