-
Notifications
You must be signed in to change notification settings - Fork 70
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
Do not require a .svg
extension
#1
Comments
@ckknight It just matches '.svg' anywhere in the string. So if you have a file named 'something.svg.png', it will wrongly get matched as svg and end up using SvgImage. But I let it match '.svg' anywhere in the string and not just in the end, since this is actually a valid filename: How do you propose the file type detection to work? I still haven't added supported for data uri yet. |
It can't be assumed that I have control over what the remote URL is. I need a way to be able to render a remote URL as though it were Ideally, it might be most appropriate to switch based on the response's |
One of the fundamental principles of Javascript is "Don’t modify objects you don’t own". This component should not attempt to augment the Image object provided by React Native but rather be named something like SVGImage instead. |
As-is, if the URI does not end in
.svg
, then it will fallback to react-native's built-inImage
implementation.(See https://github.com/seekshiva/react-native-remote-svg/blob/master/index.js#L8)
I personally would rather handle that fallback case in my own code and only use the
SvgImage
, but if I were to reach in viareact-native-remote-svg/SvgImage
, then it no longer does the automaticresolveAssetSource
.The text was updated successfully, but these errors were encountered: