Return to site

Image not available icon

broken image
broken image

active ? require ( './my-icon-active.png' ) : require ( './my-icon-inactive.png' ) Copy active ? 'my-icon-active' : 'my-icon-inactive' // GOOD var icon = this. In order for this to work, the image name in require has to be known statically.

broken image

Adding and changing images doesn't require app recompilation, you can refresh the simulator as you normally do.Only the images that are actually used will be packaged into your app.you don't have to worry about name collisions. Images live in the same folder as your JavaScript code.On Windows, you might need to restart the bundler if you add new images to your project. If there is no image matching the screen density, the closest best option will be selected. For example,, will be used on an iPhone 7, while will be used on an iPhone 7 Plus or a Nexus 5.

broken image

the bundler will bundle and serve the image corresponding to device's screen density.