-
Notifications
You must be signed in to change notification settings - Fork 906
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
fix(android): Incorrect mapping of svg files #1042
Conversation
Merging and releasing this enables using .svg files with react-native-svg without any further configuration. @grabbou @thymikee @Esemesek everyone ok with me merging this? I would be very surprised if this would break anything, as the current outcome leads to android not even building, unless one adds
to gradle.properties, at which point the files aren't fetchable, nor usable in Image components. I suspect this file extension has been added by mistake. |
Android drawable do not support svg, and never have, so I'm quite certain this has been an unintentional addition. I'll go ahead and merge this. Could we cut a new release soon? Any schedule? |
Based on the comment it looks like svg shouldn't be there indeed, but maybe it's some kind of a hack? Maybe it's not necessary now? Hard to tell at the moment. We can include it in 4.x, so it would be available in RN 0.62, and see if it breaks anywhere. Next time, please don't just merge without approval. |
Ah great, sounds good. Oh sorry if I stepped on anyones toes. Was quite certain it'd be alright to merge, and if not, revert it. |
Did this while half asleep at 4am, quite an ass move in retrospect, sorry for any inconvenience. |
Cool. I hope we can introduce this change as it seems to make sense. I'd just like more eyes on this :). Also, we've improved merging access to code owners only, so we're safer now 👍 |
Yeah, I was actually a bit surprised to have merge rights, as I haven't contributed to this package before, in my sleepy state somehow assumed it was normal react-native-community practise. |
depends on react-native-community/cli#1042 ```jsx import React from 'react'; import {LocalSvg} from 'react-native-svg'; import test from './test.svg'; export default () => <LocalSvg asset={test} />; ```
software-mansion/react-native-svg#1306
facebook/react-native#28266
facebook/metro#529
Summary:
Fix mapping of svg files. They're currently bundled to the drawable folder incorrectly.
Test Plan:
LocalSvg.js
App.js
test.svg: any svg content
The develop branch of react-native-svg contains an optimized version of LocalSvg, waiting to be released once this set of pull requests are merged.