We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When converting an SVG into a React component, allow children props so we can inject nodes into the rendered SVG element.
children
Check the example bellow:
Lets say I have an SVG with some <symbol> elements:
<symbol>
<svg xmlns="http://www.w3.org/2000/svg"> <symbol id="foo"><text>foo</text></symbol> <symbol id="bar"><text>bar</text></symbol> </svg>
Then I would be able to use like this:
import SvgSymbols from './symbols.svg'; export function Foo() { return ( <SvgSymbols> <use xlinkHref="#foo" /> </SvgSymbols> ); } export function Bar() { return ( <SvgSymbols> <use xlinkHref="#bar" /> </SvgSymbols> ); }
Why does this feature belong in the SVGR ecosystem?
It allows some level of customization on top of the static SVG component.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🚀 Feature Proposal
When converting an SVG into a React component, allow
children
props so we can inject nodes into the rendered SVG element.Motivation
Check the example bellow:
Example
Lets say I have an SVG with some
<symbol>
elements:Then I would be able to use like this:
Pitch
It allows some level of customization on top of the static SVG component.
The text was updated successfully, but these errors were encountered: