react-pdf
react-pdf copied to clipboard
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
"@react-pdf/renderer": "^4.0.0", "next": "14.2.13",
"use client";
import { PDFViewer, Document, Page, View, Text } from "@react-pdf/renderer";
const Pdf = () => {
return (
<PDFViewer width="100%" height="100%">
<Document>
<Page size="A4">
<View>
<Text>Hello World!</Text>
</View>
</Page>
</Document>
</PDFViewer>
);
};
export default Pdf;