@amazon-devices/react-native-fast-image library version 2.0.0 provides support on Vega for react-native-fast-image with a performant React Native image component.
React Native’s Image component handles image caching like browsers for the most part. If the server is returning proper cache control headers for images, you get the built-in caching behavior you see in a browser. Others have noticed:
- Flickering.
- Cache misses.
- Low performance loading from cache.
- Low performance in general.
Installation
-
Add the JavaScript library dependency in the package.json file:
-
Reinstall dependencies using the
npm installcommand.
Examples
Supported APIs
Component API
Methods
Exceptions on Vega
The React Native for Vega library has a few exceptions in terms of API support. The following features are not supported on the Vega platform.source.headerssource.cachetintColordefaultSourceonFastImageProgress(Has issues with the dependencyImage.onProgress.)
Backward compatibility issue
Vega OS versionsv0.12, OS 1.1 (201010334050), and higher are not compatible with amzn/react-native-fast-image (npm package) versions .
When running an app built against an old version of the npm package on versions v0.12 and higher of the OS, you see the following crash on startup:
Volta:Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'FastImageTurboModule' could not be found. Verify that a module by this name is registered in the native binary.
To avoid this crash, you must rebuild your app against the latest version of @amazon-devices/react-native-fast-image:
-
Make sure that your app’s
package.jsondoes not hardcode any old version of fast-image. Use the semvar version~2.0.0, so your app can pick up the latest patch. -
Delete package-lock.json to remove any locked fast-image version.
If you are relying on package-lock.json to lock other dependencies, you can manually delete the entry for
@amazon-devices/react-native-fast-image. -
Delete the
node_modulesfolder to make sure that npm doesn’t pick up an old cached version. - Rebuild your app.

