File not found error in electron app while setting background image


#1

1
down vote
favorite
I am trying to set backgroundImage which need to be working in both browser and electron app.

here is my code

style={{
backgroundImage: `url('/Users/proj/build/images/myImage.png')`,
                    width: '70%',
                    height: '70%',
                  }}

this will work while i am running electron app. but not while running the browser app.

for the browser app i need to change the above code as follows

 style={{
    backgroundImage: `url('/images/myImage.png')`,
                        width: '70%',
                        height: '70%',
                      }}

how do i make the background image loading in both cases.