Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Image constructor: 'new' is required in ReactNative

Tags:

javascript

The below code gives me the following error. What to do?

TypeError: Image constructor: 'new' is required

<Image
  style={{}}
  source={{
      uri: 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png',
        }}
/>
like image 232
DisplayName Avatar asked Jun 17 '26 13:06

DisplayName


2 Answers

Make sure you import Image from 'react-native'

import { Image } from 'react-native';
like image 95
sagaya martin Avatar answered Jun 20 '26 04:06

sagaya martin


If you're getting this error from a Next.js app then make sure to add the following import statement:

import Image from 'next/image';
like image 20
flyingfishcattle Avatar answered Jun 20 '26 02:06

flyingfishcattle



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!