Webp on React-Native

2019-08-07 16:23发布

React-Native documentation mentions that webp is not supported on Android, but says nothing about IOS. Out of the box it does not seem to work, but after installing this plugin https://libraries.io/npm/react-native-webp I can use images downloaded from internet.

Problem is that local files give me an error

: "{"type":InternalError","message":"react-packager has encountered an internal error, please check your terminal error output for more details"}

Unfortunately "react-native log-ios" command merely shows the same error there.

This is how I use the webp file after installing the plugin.

<Image
   source={require('../../assets/icon.webp')}
/>

How can I use local .webp images on React-native iOS?

0条回答
登录 后发表回答