react-native-webp adds support for WebP images for react-native components.
npm install react-native-webp --save
rnpm link
(or manually add module to your project)- Open your project in xcode
- Right click your project root and select "Add Files to ..."
- Select "WebP.framework" and "WebPDemux.framework" from node_modules/react-native-webp/ and click "OK"
- Select your Target
- Select "Build Settings"
- Add "$(SRCROOT)/../node_modules/react-native-webp" to the "Framework Search Path"
You don't have to do anything other than use WebP images. This project adds a custom RCTImageDataDecoder to your project, so all react-native components should be able to use WebP files. If you are using custom components that work with UIImages directly (without using RCTImageDataDecoder) you will have to change that code.