Mizlul
Mizlul

Reputation: 2290

JSX element type 'HTMLImageElement' is not a constructor function for JSX elements

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

Answers (1)

Titian Cernicova-Dragomir
Titian Cernicova-Dragomir

Reputation: 249696

There is an Image defined globally. You need to import the one from react-native

Upvotes: 4

Related Questions