Skip to content

Inherit Defs from Parent SVG #1284

@jacobp100

Description

@jacobp100

Feature Request

On the web, if you have an svg within another svg, you can reference the defs in the parent svg from the child - ids are global after all

Take this example,

<svg>
  <defs>
    <path id="a" d=""/>
    <path id="b" d=""/>
    <path id="c" d=""/>
  </defs>
  <use href="#a"/>
  <svg x=>
    <use href="#b"/>
  </svg>
  <use href="#c"/>
</svg>

This crashes - and it does make sense why it does

But it might be possible to fix this use-case by allowing the child to look up through the svg parents to find the relevant area

Why it is needed

This shows up a lot with the new mathjax 3 svg output using fontCache: 'local' - large brackets are represented in the same format as the example I gave above

Possible implementation

If RNSVGSvgView held an optional reference to a parent svg, this might be possible. Unsure of Android implementation

Code sample

Refer to the above code sample

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions