For displaying SVG files in react native projects, you need to install following packages:
react-native-svg-transformer

After installing packages you need to import your SVG files like this:

import React, { useState } from 'react';
import { View } from 'react-native';
import WelcomeSVG from "assets/icons/welcome.svg"

The below example shows how to use it:

return (
    <View>
<WelcomeSVG 
    width="100%"
    height="70%"
  	/>
</View>
)

 

The above code will help you in displaying SVG images. You can also set image height and width based on your requirement using width and height properties.

Need Help With React Native Development?

Work with our skilled React Native developers to accelerate your project and boost its performance.

Hire React Native Developers

Support On Demand!

Related Q&A