feathericons / react-feather

React component for Feather icons
https://npm.im/react-feather
MIT License
1.93k stars 126 forks source link

Forward ref to SVG graph #56

Closed ikornienko closed 4 years ago

ikornienko commented 4 years ago

Some libraries rely on proper ref forwarding (e.g. see tippy.js docs mentioning it). Unfortunately right now none of the icon components forward ref, which can be improved with something like

import React, { forwardRef } from 'react';

const Activity = forwardRef((props, ref) => {
  const { color, size, ...otherProps } = props;
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      ...
      ref={ref}
    >
  ...
katywings commented 4 years ago

Related: #60

carmelopullara commented 4 years ago

Feature added.