Skip to content

CJS default export types are improperly configured #191

Description

@samijaber

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions