react-diff2

0.1.3 • Public • Published

react-diff2

Highlights the differences between two piece of data. Uses the diff module. Is a fork of react-diff project.

Installation

npm i react-diff2

Demo

http://cezary.github.io/react-diff/

Example

import React from 'react';
import Diff from 'react-diff2';
 
const Component = props => {
  ...
  return (
    <Diff
      inputA="gogol"
      inputB="google"
      type="chars"
    />
  );
}

or with json:

import React from 'react';
import Diff from 'react-diff2';
 
const Component = props => {
  ...
  return (
    <Diff 
      inputA={props.oldObject} 
      inputB={props.newObject} 
      type="json"
    />
  );
}

Original project

react-diff

License

MIT

Package Sidebar

Install

npm i react-diff2

Weekly Downloads

20

Version

0.1.3

License

MIT

Unpacked Size

8.73 kB

Total Files

11

Last publish

Collaborators

  • ivanzusko