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