-
-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline SVG Import plugin with Babel for react-native #306
Comments
Hello @inf3cti0n95, I think you are looking for a SVGR Babel macro, you should give a look to https://github.com/evenchange4/svgr.macro |
@neoziro I saw that! But, I want to import SVG files directly into tsx. And babel would transpile svg code to react-native-svg code |
Hmm I don't know how to do it, sorry :x |
@inf3cti0n95 I'm not sure what your requirements are exactly, but you can try out my project that allows you to do |
@kristerkari This is exactly what I was aiming for, but at babel transformation time. But, your package seems equally good. I'll try it. Thanks. |
@kristerkari Your solution works just as I expected! Kudos! I dont' think we would need a babel plugin since the metro transformer works just fine for my use case. |
Check this out: https://www.npmjs.com/package/@dr.pogodin/babel-preset-svgr - my solution for the problem:
|
Seems solved. |
I have had a hard time, using SVG files in React native. And I want to change that. SVGR has a rich ecosystem. Which I think I can build upon a babel plugin to import svg files inline in react native project.
I need some support as general instruction and basic steps. As there is very little documentation on the core code of the SVGR packages.
I am building something like https://github.com/airbnb/babel-plugin-inline-react-svg .
Which is actually needed for react-native
The text was updated successfully, but these errors were encountered: