@superdoc-dev/react includes full TypeScript support.
TypeScript usage
Exported types
Framework integration
Next.js (App Router)
The wrapper handles SSR automatically. For additional control, usedynamic with ssr: false:
Next.js (Pages Router)
Vite / Create React App
Works out of the box:Troubleshooting
”document is not defined” (SSR)
The component handles SSR internally, but if you still see errors, use dynamic import:React Strict Mode double-mount
The component handles React 18 Strict Mode correctly. The internal cleanup flag prevents issues from double-invocation during development.Document not loading
- Verify the file is a valid
.docxdocument - Check that
documentprop is aFile,Blob, URL string, or config object - Listen for
onContentErrorevents for parsing errors
Changing document mode
The component handlesdocumentMode prop changes efficiently without rebuilding:

