diff --git a/.changeset/young-students-allow.md b/.changeset/young-students-allow.md new file mode 100644 index 000000000..21791ff79 --- /dev/null +++ b/.changeset/young-students-allow.md @@ -0,0 +1,5 @@ +--- +'@react-pdf/renderer': patch +--- + +Improved `children` prop types for react@18. diff --git a/packages/renderer/index.d.ts b/packages/renderer/index.d.ts index 3975c061e..d116f5f1d 100644 --- a/packages/renderer/index.d.ts +++ b/packages/renderer/index.d.ts @@ -29,7 +29,6 @@ declare namespace ReactPDF { language?: string; pdfVersion?: PDFVersion; onRender?: (props: OnRenderProps) => any; - children?: React.ReactNode; } /** @@ -76,7 +75,6 @@ declare namespace ReactPDF { orientation?: Orientation; dpi?: number; bookmark?: Bookmark; - children?: React.ReactNode; } /** @@ -103,7 +101,6 @@ declare namespace ReactPDF { pageNumber: number; subPageNumber: number; }) => React.ReactNode; - children?: React.ReactNode; } /** @@ -135,7 +132,7 @@ declare namespace ReactPDF { * A React component for displaying network or local (Node only) JPG or * PNG images, as well as base64 encoded image strings. */ - class Image extends React.Component> {} + class Image extends React.Component {} interface TextProps extends NodeProps { id?: string; @@ -155,7 +152,6 @@ declare namespace ReactPDF { subPageNumber: number; subPageTotalPages: number; }) => React.ReactNode; - children?: React.ReactNode; /** * Override the default hyphenation-callback * @see https://react-pdf.org/fonts#registerhyphenationcallback @@ -202,7 +198,6 @@ declare namespace ReactPDF { */ debug?: boolean; src: string; - children?: React.ReactNode; } /** @@ -215,7 +210,7 @@ declare namespace ReactPDF { children: string; } - class Note extends React.Component> {} + class Note extends React.Component {} interface CanvasProps extends NodeProps { /** @@ -230,7 +225,7 @@ declare namespace ReactPDF { ) => null; } - class Canvas extends React.Component> {} + class Canvas extends React.Component {} interface SVGProps extends NodeProps { /** @@ -425,7 +420,7 @@ declare namespace ReactPDF { * @see https://react-pdf.org/advanced#on-the-fly-rendering * @platform web */ - class BlobProvider extends React.Component> {} + class BlobProvider extends React.Component {} interface PDFViewerProps { width?: number | string; @@ -441,7 +436,7 @@ declare namespace ReactPDF { * Iframe PDF viewer for client-side generated documents. * @platform web */ - class PDFViewer extends React.Component> {} + class PDFViewer extends React.Component {} interface PDFDownloadLinkProps { document: React.ReactElement; @@ -459,7 +454,7 @@ declare namespace ReactPDF { * @see https://react-pdf.org/advanced#on-the-fly-rendering * @platform web */ - class PDFDownloadLink extends React.Component> {} + class PDFDownloadLink extends React.Component {} interface UsePDFInstance { loading: boolean;