Unable to add a local image.
I tried:
const MyApp = () => {
return(
<Text>
Some Text
</Text>
<Image source={require('./story1.jpg')} />
)
}
Also tried:
const MyApp = () => {
return(
<Text>
Some Text
</Text>
<Image source={require('./story1.jpg')}> </Image>
)
}
Error: Error: TransformError SyntaxError: ----------/src/Components/Story1.js: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (39:2)
Why am I getting this error? What am I doing wrong? The image is in the same folder where this component is present.