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.
Answered by
nandorojo
Nov 6, 2023
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.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/