react-diff-viewer icon indicating copy to clipboard operation
react-diff-viewer copied to clipboard

CJS default export types are improperly configured

Open samijaber opened this issue 1 year ago • 0 comments
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

samijaber avatar Dec 12 '23 20:12 samijaber