The current typings for SVG files given on the installation docs are actually giving me a [ts] Generic type 'SVGAttributes<T>' requires 1 type argument(s). error on vscode.
This is probably because, using the latest typings, React.SVGAttributes expect a generic argument (probably SVGSVGElement, but not too sure about that).
There is an open PR on create-react-app to add support to Typescript, and looking through the code, we can find their typing file, which includes jpg and png files as well. Maybe we could replace the current typings with those?
Thanks for the call out. I had a goofy setting set in tsconfig.json which prevented this error from surfacing. I've updated the docs and examples to match.
The current typings for SVG files given on the installation docs are actually giving me a
[ts] Generic type 'SVGAttributes<T>' requires 1 type argument(s).
error on vscode.This is probably because, using the latest typings,
React.SVGAttributes
expect a generic argument (probablySVGSVGElement
, but not too sure about that).There is an open PR on
create-react-app
to add support to Typescript, and looking through the code, we can find their typing file, which includesjpg
andpng
files as well. Maybe we could replace the current typings with those?By the way, I'm using the following versions: