DEV Community

Discussion on: How to obtain a URI for an image asset in React Native (With Expo)

Collapse
 
nbaua profile image
Nhilesh Baua • Edited

Hi,
Nice post, however there still is a problem with the
** Image.resolveAssetSource(item.avatar).uri ** when there are multiple images which needs to be loaded from assets folder.

Real world scenario:

I have an application, which uses the Flatlist (maximum of 20-30 items) for the order,
these line items can have any one of the five possible flags (read statuses),
originally my idea was to load from assets, since this 5 images would be easier to manage locally. however with this issues with react lead us to host those 5 images on the server and cache them for forever at least for now.

because even the dynamic loading fails at a time and the status does not load sometimes.