Native react-native-svg doesn't work #447
-
Using an expo-router starter pack.
Installed react-native svg both into /packages/app and /apps/expo. It works fine in my next app (I added the package in transpilePackages), but ios native app gives me a bunch of errors, basically for each element inside the svg tag: Native code in _layout.tsx:
What did i do wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Your SVG component is using HTML elements instead of importing them from RNSVG. If you’re using SVGr, be sure to enable the react native flag. |
Beta Was this translation helpful? Give feedback.
Notice how they're importing the components and using those. The option is there if you're using SVGR codegen. You need to convert your SVGs to react native components.
https://react-svgr.com/