Skip to content

Use <use> in svg defs #8

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
martijnvermaat opened this issue Feb 21, 2016 · 3 comments
Open

Use <use> in svg defs #8

martijnvermaat opened this issue Feb 21, 2016 · 3 comments

Comments

@martijnvermaat
Copy link
Member

Was: GitLab #32

We should define shapes and other symbols in the <defs/> element in svg for reuse.

@martijnvermaat
Copy link
Member Author

However, this approach requires the use of <use xlink:href="#id"/> tag with custom xml namespace, which is not supported by React at this moment.

This issue tracks the support of SVG tags in React in general: facebook/react#1657

@gaearon
Copy link

gaearon commented Mar 15, 2016

However, this approach requires the use of tag with custom xml namespace, which is not supported by React at this moment.

I believe this to be incorrect. You can see in this fiddle that xlink:href is supported. It just needs to be written as xlinkHref= instead:

<use xlinkHref="#shape" x="50" y="50" />

@martijnvermaat
Copy link
Member Author

Looks like that would certainly work for us, I'll give it a go.

Thanks a lot for leaving a comment here! ✋

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants