interface ISVGProps {
reference?: React.RefObject<SVGSVGElement>
}
const SVG = (props: ISVGProps) => {
return (
<svg
ref={props.reference}
className={classes.Triangle}
{...props} />
<path d='M0,0 10,10 20,0' />
</svg>
)
}
<SVG reference={myReference} />
React svg element
Pass down reference and apply the prop type to a SVG
0 Comments
Add Comment
Log in to add a comment