score:0

Accepted answer

try import image as component (correct way, require image - bad practice)

app.js

import photo from './assets/photo.jpg'
...
<intro content={{ 
   image : photo, // pass photo as prop
   name : "hello",
   text : "an undergraduate electrical and electronic engineering student"
}} /> 

intro.js

...
<img src={props.content.image}/>

score:-1

remove the require and keep the path '/assets/photo.jpg' react will redirect automatically to the public folder. make sure assets is under public.


Related Query

More Query from same tag