So you have to add an import statement on your parent component:
class ParentClass extends Component {
render() {
const img = require('../images/img.png');
return (
<div>
<ChildClass
img={img}
/>
</div>
);
}
}
and in the child class:
class ChildClass extends Component {
render() {
return (
<div>
<img
src={this.props.img}
/>
</div>
);
}
}