tanem / react-svg

:art: A React component that injects SVG into the DOM.

Home Page:https://npm.im/react-svg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ref type is incompatible

emmmarosewalker opened this issue · comments

The type exported in Props cannot be used to pass props through, the ref type is incompatible

https://codesandbox.io/s/awesome-danilo-53evfe?file=/src/App.tsx

Hey @emmmarosewalker. Try using ReactSVG instead of the Props export in your IconProps type:

export type IconProps = {
  name: IconName;
} & Omit<ReactSVG, "src">;

Here's a fork of your example: https://codesandbox.io/s/wizardly-kapitsa-zyf8ue?file=/src/App.tsx.

Closing due to inactivity.