javascript - Include and reference an image in react with webpack -


what ist best way include , reference images react-usage in singlepage javascript app build , bundled webpack?

so far have

return (<img src={require('./pic.png'}</div>) 

is there better way?

if you're using webpack's url-loader can tell automatically embed data uri if file size under specified limit.

require("url?limit=10000!./pic.png"); // => dataurl if "pic.png" smaller 10kb 

Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -