Webp on React-Native

南楼画角 提交于 2019-12-11 05:07:48

问题


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?

来源:https://stackoverflow.com/questions/44909160/webp-on-react-native

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!