I am able to add static images to a ListView
cell just fine (see code below), but how do I change the icon image dynamically?
From React Native Docs
The images have to be known during packaging. There's a section about it in the docs.
Put this at the top of the file you define ExpandingCell in:
const MAGNIFYING_GLASS_ICON = require('./CellIcons/MagnifyingGlassIcon.png');
Then you can use the constant like this
let icon = someCondition ? MAGNIFYING_GLASS_ICON : SOME_OTHER_ICON;
<Image source={icon}/>
You have to have the requires for all images you want to use this way in there.