javascript - TypeError: Image constructor: 'new' is required in ReactNative - Stack Overflow

The below code gives me the following error. What to do?TypeError: Image constructor: 'new' i

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

TypeError: Image constructor: 'new' is required

<Image
  style={{}}
  source={{
      uri: '.png',
        }}
/>

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

TypeError: Image constructor: 'new' is required

<Image
  style={{}}
  source={{
      uri: 'https://www.google./images/branding/googlelogo/2x/googlelogo_color_92x30dp.png',
        }}
/>
Share Improve this question edited Jul 28, 2020 at 21:04 bad_coder 13k20 gold badges56 silver badges88 bronze badges asked Jul 28, 2020 at 12:12 DisplayNameDisplayName 811 silver badge4 bronze badges 1
  • Could you add some more of your code – Sachin Yadav Commented Jul 28, 2020 at 12:27
Add a ment  | 

2 Answers 2

Reset to default 9

Make sure you import Image from 'react-native'

import { Image } from 'react-native';

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';

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743665010a4486826.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信