Forked from dbasedow/react-native-webp
react-native-webp adds support for WebP images for react-native components.
This fork ads togheter some changes made by other forks separately and updates the installation instructions. All that for a succesfull installation on a iOS device of a project that was detached/ejected from Expo.
yarn add https://github.com/Symyon/react-native-webp
react-native link
- 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" of your main project.
- Add "$(SRCROOT)/../../ios/Pods/Headers/Public" to the "Header Search Path" of the ReactNativeWebp project (recursive).
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.