react-diff-viewer
react-diff-viewer copied to clipboard
CJS default export types are improperly configured
trafficstars
To be able to use the package in my library (which is built as a dual ESM/CJS lib via tsup) , I had to resort to this hack:
import ReactDiffViewer from "react-diff-viewer";
const DiffViewer: typeof ReactDiffViewer = (ReactDiffViewer as any).default
? (ReactDiffViewer as any).default
: ReactDiffViewer;
For more information:
https://arethetypeswrong.github.io/?p=react-diff-viewer%403.1.1