SVG component types missing children prop
Describe the bug When try to use with Typescript setup for SVG component gives following error.
No overload matches this call.
Overload 1 of 2, '(props: SVGProps | Readonly<SVGProps>): Svg', gave the following error.
Type '{ children: Element; viewBox: string; style: Style; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Svg> & Readonly<SVGProps>'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Svg> & Readonly<SVGProps>'.
To Reproduce Steps to reproduce the behavior including code snippet (if applies):
- Create Typscript project.
- Try to create a Document with SVG component.
Expected behavior SVG component should be able to have props.
Desktop (please complete the following information):
- OS: [MacOS]
- React-pdf version: "2.3.0",
The same also holds true for the G component. A possible solution would be to add the prop "children?: React.ReactNode" somewhere in the type definition similar to #1811
Same here
Still open as of "@react-pdf/renderer": "^3.0.2" right?
Still open as of "@react-pdf/renderer": "^3.0.2" right?
@MBeggiato At least the issue from this branch https://github.com/diegomura/react-pdf/pull/2087 is still not fixed
I suppose this is due to a React 18 requirement, right ?
Is there any workaround available other than downgrading back to 17 ?
I suppose this is due to a React 18 requirement, right ?
@bogdan-calapod Probably!
Is there any workaround available other than downgrading back to 17 ?
You can do declare module '@react-pdf/renderer' which will ignore all types and you won't have typings