Skip to content

Import statement for jsdiff #199

Closed
Closed

Description

@harmeetjaipur

Hi, I have been looking for a good diff checker that can deal with html inside the content and your project seems like it can deal with that.

I feel stupid asking this but what is the import name for jsdiff for ReactJs? I tried import JsDiff from 'diff' but JsDiff stays undefined.

Activity

  1. harmeetjaipur commented on Oct 6, 2017

    @harmeetjaipur
    Author

    Found the '*' solution on another post.

  2. devloe commented on May 2, 2018

    @devloe

    Can you post the solution here?

  3. Martii commented on Jan 7, 2019

    @Martii
    Contributor

    @devloe
    This is the core npmjs.com package at https://www.npmjs.com/package/diff . So package.json item should be, at current, "diff": "4.0.1"

    Seems there is some current README.md issues too with using JsDiff (ex. here and a bunch of other places in this DOC)... almost skipped this update with diff@4.0.1 since it failed in usage tests. Had to change JsDiff Object reference in DOM script to plain Diff. Cc: @kpdecker

  4. added 2 commits that reference this issue on Jan 7, 2019
  5. clouedoc commented on Apr 26, 2021

    @clouedoc

    The * solution if anyone is wondering. Thanks to the OP.

    import * as Diff from "diff";
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