Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 294
Mizlul Avatar asked Oct 17 '25 03:10

Mizlul


1 Answers

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

like image 164
Titian Cernicova-Dragomir Avatar answered Oct 18 '25 22:10

Titian Cernicova-Dragomir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!