Fix `TablerIconProps` type definition
Fixes #294
Extending an interface implies that a value of the subtype can be assigned to the supertype, but TablerIconProps can't be assigned to SVGAttributes<SVGElement> because the stroke property is incompatible (because it is actually used to set the strokeWidth).
Instead, this PR uses Omit to remove the overridden properties from the base type and adds them to the props by referencing the type of the SVG attributes that they ultimately are used to set. This approach has the advantage of guaranteeing that these property types are consistent with React (in particular, they explicitly allow undefined, which is needed with exactOptionalPropertyTypes).
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| tabler-icons | ✅ Ready (Inspect) | Visit Preview | Sep 16, 2022 at 11:06AM (UTC) |
@haines thank you so much! ❤️