I'm trying to use react-pdf to render a pdf document. I have a react app generated by create-react-app. I have followed the instructions mentioned in the github readme for CRA (https://github.com/wojtekmaj/react-pdf#create-react-app).
import { Document, pdfjs } from "react-pdf";
pdfjs.GlobalWorkerOptions.workerSrc = `https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js`;
I have placed a sample PDF file in ./public/dummy.pdf.
I am using the Document component as below but nothing gets rendered on the page.
<Document file="http://localhost:3000/dummy.pdf" />
This is what it looks like in React DevTools for Chrome

What am I missing?


