I am using react for my application. I have a div
that I would like to have a background image. But I can't get it to show.
When I include it in the src
folder as myapp/src/bgimage.png
it works perfectly but I've heard that I should include it in a folder named images
at the root level so it's myapp/images/bgimage.png
, however this does not work for me and gives me:
You attempted to import ../images/bgimage.png which falls outside of the project src/ directory.'
Can anyone tell me the proper way to include image assets in reactJS?