How do I fix the identifier expected error when using typescript, react, and svgs?
return (
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" >
<defs> ... </defs>
<use ... xlink:href="#path-1"/>
</svg>
);
Use the react specific spelling (JSX) for each attribute, for example:
return (
<svg version="1.1" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink" >
<defs> ... </defs>
<use ... xlinkHref="#path-1"/>
</svg>
);
xmlnsXlink
xlinkHref
also see:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With