I am trying to pass image path via props using
require("./house.jpg");
but it gives a broken image, the path for my image is under src.
How should I pass the image path to the props in React?
const imagesrc =require("./house.jpg");
ReactDOM.render(
<React.StrictMode>
<Header />
<HomeBanner width='100%' height='400px' alt="Banner image" src={imagesrc} />
<App />
</React.StrictMode>,
rootElement
)
srcprop ofHomeBanner?