![]() ![]() Note that image sources required this way include size (width, height) info for the 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. Images can be distributed via npm packages.The bundler knows the image dimensions, no need to duplicate it in the code.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. ![]() ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |