react component inside SVG
See original GitHub issueIn svg we have <ForeignObject>
that can render html content inside svg. It is very useful for complex layout elements.
I think in react-native we need something like <ForeignObject>
that can render react components (<View>
, <Text>
…) inside svg.
@msand What do you think? Is it possible?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:14
Top Results From Across the Web
React component inside an SVG element - Stack Overflow
I want to embed a custom react component inside an SVG but it's not working. Is it even allowed in an SVG? if...
Read more >How to use SVGs in React - LogRocket Blog
SVGs can be imported and used directly as a React component in your React code. The image is not loaded as a separate...
Read more >Building SVG Components with React.js and d3.js - pganalyze
The mechanics of using SVG elements in React are straightforward: Just write a standard component and return an SVG tag instead of an...
Read more >How to use SVGs in React | Sanity.io guide
There are a few ways to use an SVG in a React app: Use it as a regular image; Import it as a...
Read more >React SVG: How to use SVGs best in React - CopyCat Blog
Importing SVG in React as JSX ... Another way to import SVG in react with full control of its customization is by converting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixing this would probably allow nesting Svg elements inside each other as well, which I’m not sure why it doesn’t work, haven’t investigated it properly yet. @magicismight @brentvatne @dustinsavery you have any ideas?
Closing this, as nesting svg inside svg works, and another issue is already open for foreignObject support: https://github.com/react-native-community/react-native-svg/issues/447