Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebP format for an Expo app on react-native

How can we enable Webp format for iOS and Android in an Expo project without ejecting.

like image 795
Shivansh Jagga Avatar asked Oct 16 '25 01:10

Shivansh Jagga


1 Answers

it works on expo Go. you can check: https://snack.expo.dev/6T9fiBmZL

maybe you forgot to add height width

Code

import React from 'react'
import { StyleSheet, View,Image } from 'react-native';
const App = () => {

  return (
    <View style={styles.container}>
  <Image source={{uri:"https://www.gstatic.com/webp/gallery/1.sm.webp"}} style={{height:200,width:200}} />
    </View>
  );
};

const styles = StyleSheet.create({
  container: {
     flex:1,
    justifyContent:"center",
    alignItems:"center",
   
  },
});

export default App
like image 191
Muhammad Numan Avatar answered Oct 17 '25 17:10

Muhammad Numan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!