react-text-diff

1.0.0 • Public • Published

react-text-diff

A react component of diff text.

Install

npm install react-text-diff

Usage

import {Component} from 'react';
import CodeDiff from 'react-text-diff';
 
class Demo extends Component{
    constructor(props) {
        super(props);
        this.state = {
            oldStr: oldStr,
            newStr: newStr,
            context: 100000, // max 100000
            outputFormat: 'side-by-side' //'line-by-line' or 'side-by-side'
        }
    }
    render(){
        return (
            <div>
                <CodeDiff oldStr={oldStr} newStr={newStr} context={context} outputFormat={outputFormat}/>;
            </div>
        )
    }
}
 
export default Demo;

Test Demo

git cloen xxx
npm i
npm run dev

demo

Readme

Keywords

Package Sidebar

Install

npm i react-text-diff

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

136 kB

Total Files

10

Last publish

Collaborators

  • stevenzwzhai