admin管理员组文章数量:1341417
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
2 Answers
Reset to default 9Make 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';
本文标签: javascriptTypeError Image constructor 39new39 is required in ReactNativeStack Overflow
版权声明:本文标题:javascript - TypeError: Image constructor: 'new' is required in ReactNative - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743665009a2518580.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论