-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Presentation attributes in Svg tag show TS error #1873
Comments
i create a Pullrequest with a Solution in #2082 |
INFO: this issue should be solved see PR #1798 |
@papack can i close this issue then? |
@jeetiss my problem is fixed. this bug should also be fixed with it. i found this ticket via google when i had the problem. In my opinion it can be closed. But i am not the ticket creator or a maintainer. if i was a maintainer i would close it and ask @rubenvar to open it again if his problem still exists :) |
I can't re-open the issue, but the issue still exists. Please check the basic reproduction in codesandbox. After updating @react-pdf/renderer to the last version (3.1.3) I get the following TS error when using valid presentation attributes:
|
Ok, I found out that adding the presentation attributes in the interface SVGProps extends NodeProps {
/**
* Enables debug mode on page bounding box.
* @see https://react-pdf.org/advanced#debugging
*/
debug?: boolean;
width?: string | number;
height?: string | number;
viewBox?: string;
preserveAspectRatio?: string;
+ strokeWidth?: string;
} Of course adding just one changes the TS error to show on the next attribute. All the valid attributes (as per the docs) should be added I guess. Would this be the right way to do it? I can try to send a PR if it will help :) |
Sounds like a great plan! I will merge it |
Describe the bug
In a TS project, when defining any presentation attribute in a
<Svg>
element, I get the following TS error:The svg is rendered correctly.
To Reproduce
<Svg>
tag, ie.<Svg strokeWidth={2}>...</Svg>
.See the reproduction in a TS codesandbox project. Note that the small svg icon is rendered correctly.
Expected behavior
It shouldn't show a TS error in these (as per the docs) allowed attributes.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: