antoine-giret Github contribution chart
antoine-giret Github Stats
antoine-giret Most Used Languages

Activity

04 Oct 2022

Issue Comment

Antoine-giret

fix: missing displayArrayKey props in TS typings

Small fix for missing displayArrayKey property in TypeScript typings, as specified in README.

Forked On 04 Oct 2022 at 07:49:12

Antoine-giret

Hello, any news on this ?

Commented On 04 Oct 2022 at 07:49:12
Issue Comment

Antoine-giret

Throwing Error in React 18

Describe the bug Using the package in react 18 is giving the error of children not mentioned in the props

To Reproduce Steps to reproduce the behavior including code snippet (if applies):

  1. Create a Sample File using React 18
  2. Try to Run the app
  3. See error

'(props: DocumentProps | Readonly<DocumentProps>): Document', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Document> & Readonly<DocumentProps>'. Overload 2 of 2, '(props: DocumentProps, context: any): Document', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Document> & Readonly<DocumentProps>'.ts(2769) @diegomura

I belive in react 18 you need to explicitly define the children props https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html

Forked On 06 Sep 2022 at 07:54:15

Antoine-giret

Add those lines to a d.ts file fix the error for now :

declare module '@react-pdf/renderer' {
  export { Circle, G, Path } from '@react-pdf/renderer';

  export class Svg extends React.Component<React.PropsWithChildren<SVGProps>> {}
} 

Commented On 06 Sep 2022 at 07:54:15