1

I'm searching without success information everywhere on the web on how to create an SVG Rect element in React-Native using the react-native-svg feature. What I reached so far is to define some SVG elements in a component and to pass props to the existing SVG Elements like Rect , Circle and so on. But how can I programmatically create a random number of SVG elements and to attach them to the component ? Sadly, it is not specified in the documentation.

Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78

1 Answers1

0

I could not find anything on the react-native-svg also.

But this post could be helpfull: How to show SVG file on React Native?.

You have to convert the .svg to JSX like is answered there by Ihor Burlachenko, notice that react-native is deferent from react, in react-native you need to use the react-native-svg module to create the svg JSX component

Jose Villalobos
  • 539
  • 5
  • 9