React-native-uri no longer well supported - Can react-native-svg support SvgXmlData instead?
See original GitHub issueFeature Request
React-native-uri no longer seems supported (last commit was in 2018 and many open PRs) - read more
Can react-native-community pull in this use case or otherwise take over and support this library?
Why it is needed
React-native-svg-uri is unique because it allows rendering SVGs from a data string. This is crucial for anyone composing their svgs on the server. (svgXmlData)
react-native-svg-uri currently also supports rendering a static image. IMO, react-native-uri doesn’t actually need to support fetching from a static file since react-native-svg-transformer fills that niche.
Solutions
One idea is to clone react-native-svg-uri
into react-native-community/react-native-svg-uri, merge in the current existing pull requests and do minor bug fixes support the last few RN versions.
Another idea is to create a new SVG data rendering component from scratch inside react-native-svg
import {SvgXmlData} from 'react-native-svg'; ... <SvgXmlData source={'svg'} />
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:16
Top GitHub Comments
With uri support:
Amazing work and quick response - thank you so much!
I was able to run the example in the readme no problem. However, I found a few cases blocking me from using my existing web svgs:
Failure 1: Adding inline style to text
TypeError: Cannot read property 'trim' of undefined
Failure 2: Including a <style> tag
Failure 3: Accessibility elements title + desc
It also broke on
<use xlink:href ... />
but that’s not supported in svg2, and href works fine.Thanks again!