Skip to content

Ref and Memo options break rest props typing #440

@katywings

Description

@katywings

🐛 Bug Report

Using svgr with the "--ref" option results in "Property does not exist in ..." typescript errors for rest-spread props:

propDoesNotExist

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)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions