Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CJS default export types are improperly configured #191

Open
samijaber opened this issue Dec 12, 2023 · 0 comments
Open

CJS default export types are improperly configured #191

samijaber opened this issue Dec 12, 2023 · 0 comments

Comments

@samijaber
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant