I have an SVG path, that needs to be filled with background image like this:
I tried to find any ways to do it in Google and that's what I've found:
<div className="intro">
<p>Any text</p>
<svg fill="url(#pattern)">
<defs>
<pattern id="pattern">
<image href={introImage}/>
</pattern>
</defs>
<path d={path()}/>
</svg>
</div>
But it doesn't work, all I get is SVG with no background, although if I set fill="red"
it works.
I think that it doesn't work because of React, it is not just HTML after all... The link for the image is correct, the "d" attribute of path either, I've checked it any times.
So, how can I solve my problem?