Reputation: 2290
I am trying an example with React Native and Typescript and for the following code:
<Image
style={{
width: 51,
height: 51,
resizeMode: 'contain',
}}
source={{ uri: portretPhoto }}
style={styles.uploadedImage}
resizeMode="contain"
/>
I get error: JSX element type 'HTMLImageElement' is not a constructor function for JSX elements. Type 'HTMLImageElement' is missing the following properties from type 'ElementClass': render, context, setState, forceUpdate, and 3 more.
How do I fix it?
Upvotes: 4
Views: 1808
Reputation: 249696
There is an Image
defined globally. You need to import the one from react-native
Upvotes: 4