lumc-nested / nested-editor

Pedigree editor component for React
https://lumc-nested.github.io/
MIT License
3 stars 1 forks source link

Use <use> in svg defs #8

Open martijnvermaat opened 8 years ago

martijnvermaat commented 8 years ago

Was: GitLab #32

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

martijnvermaat commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

Thanks a lot for leaving a comment here! :hand: