This is incorrect:

let Document = require('react-pdf');
let Page = require('react-pdf');

You are importing the entire module when you do this. That means that Document and Page both contain all the modules of react-pdf. Instead what you want to do is either import ReactPDF and reference those modules:

const ReactPDF = require('react-pdf');

<ReactPDF.Document />
<ReactPDF.Page />

or you could use destructuring:

import { Document, Page } from 'react-pdf';

//or

const { Document, Page } = require('react-pdf'); 

If TypeScript complains about missing declarations, just add a @types folder to your project, create a subfolder inside of it called react-pdf and file inside that folder called index.d.ts with one line:

declare module "react-pdf"
Answer from Robbie Milejczak on Stack Overflow
🌐
npm
npmjs.com › package › @types › react-pdf
@types/react-pdf - npm
Stub TypeScript definitions entry for react-pdf, which provides its own types definitions. Latest version: 7.0.0, last published: 2 years ago. Start using @types/react-pdf in your project by running `npm i @types/react-pdf`. There are 30 other projects in the npm registry using @types/react-pdf.
      » npm install @types/react-pdf
    
Published   Jun 06, 2023
Version   7.0.0
🌐
npm
npmjs.com › package › react-pdf
react-pdf - npm
February 25, 2026 - This package is used to display existing PDFs. If you wish to create PDFs using React, you may be looking for @react-pdf/renderer.
      » npm install react-pdf
    
Published   Feb 25, 2026
Version   10.4.1
Author   Wojciech Maj
🌐
React PDF Viewer
react-pdf-viewer.dev › docs › getting-started
Getting started - React PDF Viewer
React PDF Viewer is powered by React hooks completely. So it requires React 16.8 or later. If you are using TypeScript, then it requires TypeScript 3.8 or later.
🌐
React-pdf
react-pdf.org
React-pdf
React renderer for creating PDF files on the browser and server
🌐
GitHub
github.com › wojtekmaj › react-pdf › issues › 899
Please include TypeScript types in the package itself · Issue #899 · wojtekmaj/react-pdf
November 30, 2021 - B) Using those .d.ts files, react-pdf could be refactored to TypeScript .tsx files so react-pdf is written in TypeSript.
Author   dantman
🌐
Isquaredsoftware
blog.isquaredsoftware.com › presentations › pdfs › Mark Erikson - Introduction to React, Redux, and TypeScript (2020).pdf pdf
Intro to React, Redux, and TypeScript - Mark's Dev Blog
Parent Directory - 2016-10-rev... - 2025-05-maintaining-..> 2025-06-03 20:24 - 2025-06-state-react-..> 2025-06-13 04:36 - js-for-java-devs-wip/ 2019-05-17 14:27 - might-need-redux-eco..> 2017-09-18 21:41 - pdfs/ 2020-12-20 18:45 - react-redux-ts-intro..> 2020-12-20 13:28 ...
Find elsewhere
🌐
GitHub
github.com › react-pdf-viewer › react-pdf-viewer
GitHub - react-pdf-viewer/react-pdf-viewer: A React component to view a PDF document · GitHub
A React component to view a PDF document. It's written in TypeScript, and powered by React hooks completely.
Starred by 2.6K users
Forked by 296 users
Languages   TypeScript 97.5% | CSS 2.5%
🌐
Medium
medium.com › investing-in-tech › creating-api-driven-pdfs-on-the-fly-in-the-browser-using-react-react-pdf-and-typescript-78ab4d1e7da5
Creating API driven PDFs on the fly in the browser using React, react-pdf and TypeScript | by Paul Brickles | ii technology blog | Medium
June 27, 2019 - To avoid the complexity caused by calling our own API, I’m going to use the Random User Generator api to display some simple user details on a PDF. It’s worth noting that these examples also use TypeScript to develop our web app, and this example follows suit. Using React.useState we set initial states for requesting, error, attempts and data to allow for our stepped approach outlined above.
🌐
GitHub
github.com › diegomura › react-pdf › issues › 2093
React Pdf not working with typescript on Node JS + Express · Issue #2093 · diegomura/react-pdf
November 25, 2022 - I'm not able to run React-Pdf (@react-pdf/renderer) using typescript on Express JS server. I'm trying to run it using babel but it is not working. These are the errors which I'm getting. Github rep...
Author   shenoymithun70
🌐
GitHub
github.com › react-pdf-dev › starter-rp-react-ts-vite
GitHub - react-pdf-dev/starter-rp-react-ts-vite: React PDF Starter toolkit with React, TypeScript and Vite
Welcome to the React PDF Starter Toolkit! This repository provides a comprehensive guide on integrating React PDF with React, TypeScript and Vite.
Author   react-pdf-dev
🌐
GitHub
github.com › wojtekmaj › react-pdf
GitHub - wojtekmaj/react-pdf: Display PDFs in your React app as easily as if they were images. · GitHub
This package is used to display existing PDFs. If you wish to create PDFs using React, you may be looking for @react-pdf/renderer.
Starred by 11K users
Forked by 999 users
Languages   TypeScript 94.5% | CSS 5.4% | HTML 0.1%
🌐
Nutrient
nutrient.io › blog › sdk › how to build a reactjs pdf viewer with react pdf
How to build a React PDF viewer with react-pdf (2026) - Nutrient
January 28, 2026 - Yes. react-pdf ships type definitions and exports types like DocumentProps, PageProps, ThumbnailProps, and OutlineProps. This tutorial includes a full TypeScript implementation with a typed PDFViewerProps interface.
🌐
Embedpdf
embedpdf.com › react-pdf-viewer
React PDF Viewer – Open Source, Headless & Customizable | EmbedPDF
Build your React PDF viewer your way. Choose between a drop-in component with beautiful UI or headless hooks for complete control. Open source, TypeScript-first, works with MUI, Chakra, Tailwind & more.
🌐
npm
npmjs.com › package › @react-pdf › renderer
react-pdf/renderer
4 days ago - import React from 'react'; import ReactDOM from 'react-dom'; import { PDFViewer } from '@react-pdf/renderer'; const App = () => ( <PDFViewer> <MyDocument /> </PDFViewer> ); ReactDOM.render(<App />, document.getElementById('root'));
      » npm install @react-pdf/renderer
    
Published   Apr 06, 2026
Version   4.4.0
Author   Diego Muracciole
🌐
Syncfusion
help.syncfusion.com › documentation › document processing › pdf › pdf viewer › react › getting started
Getting started with Standalone React PDF Viewer component| Syncfusion
in 2 months - Add the React PDF Viewer as shown below in src/index.js when using JavaScript (JSX). If you’re using TypeScript (TSX), add it in src/app.tsx to render the PDF Viewer component.
🌐
DEV Community
dev.to › mfts › building-a-beautiful-document-viewer-with-react-pdf-666
Building a Document Viewer with react-pdf - DEV Community
March 9, 2025 - Y/N # select `Y` for typescript Would you like to use ESLint with this project? Y/N # select `Y` for ESLint Would you like to use Tailwind CSS with this project? Y/N # select `Y` for Tailwind CSS Would you like to use the `src/ directory` with this project? Y/N # select `N` for `src/` directory What import alias would you like configured? `@/*` # enter `@/*` for import alias · There are actually two npm packages called "react-pdf": one is for displaying PDFs and one is for generating PDFs.
🌐
npm
npmjs.com › package › @pdf-viewer › react
pdf-viewer/react
February 16, 2026 - Although React PDF can run on most JavaScript module bundlers, it is more vigorously tested on Vite and Webpack. Remark: - If using TypeScript, it requires >= TypeScript 4.6.
      » npm install @pdf-viewer/react
    
Published   Feb 16, 2026
Version   1.19.0
Author   React PDF Viewer