A demonstration of how the react-pdf should work with CRA-generated application.
Stack: React, React-PDF.
git clone https://github.com/peterdee/pdf-view
cd ./pdf-view
nvm use 14
npm i -g yarn
yarnModule versions are locked.
This is necessary only for the react-pdf though, as the contents of worker.js in the public directory was copied from the pdfjs-dist/build/pdf.worker.min.js file.
yarn startApplication is available at http://localhost:3000
yarn buildThe public directory contains a worker.js file that should be copied to the build folder, otherwise react-pdf will not work properly when static files are created.
yarn serveStatic files are served with express on http://localhost:5500