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} />
      

      Typescript language logo
      React svg element

      Codiga's TypeScript Recipes

      Pass down reference and apply the prop type to a SVG

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.