-
-
Notifications
You must be signed in to change notification settings - Fork 431
Closed
Labels
Description
🐛 Bug Report
Using svgr with the "--ref" option results in "Property does not exist in ..." typescript errors for rest-spread props:
To Reproduce
- Create a typescript environment (in my case I used codesandbox and locally nextjs)
- Create svg components with
svgr --ref
- Make sure that the svg component is imported with types (allowJs enabled in tsconfig)
- (Note: the error happens independent if the --typescript svgr option is set or not
Expected behavior
Rest spreaded props should be possible while using forwardRef
Link to repl or repo (highly encouraged)
- Demo: https://codesandbox.io/s/dreamy-lederberg-7xkwz?file=/src/App.tsx:340-345
- There are two icon components in the demo:
- Icon: original icon generated by svgr with
svgr --ref ...
- IconFixed: icon after my pr which follows in a few minutes :D
- Icon: original icon generated by svgr with
Run npx envinfo --system --binaries --npmPackages @svgr/core,@svgr/cli,@svgr/webpack,@svgr/rollup --markdown --clipboard
## System:
- OS: Linux 4.19 Manjaro Linux
- CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
- Memory: 5.68 GB / 15.39 GB
- Container: Yes
- Shell: 5.0.16 - /bin/bash
## Binaries:
- Node: 12.15.0 - /usr/local/bin/node
- Yarn: 1.16.0 - ~/.npm-global/bin/yarn
- npm: 6.13.4 - /usr/local/bin/npm
gynekolog