react-text-diff
v1.0.0
Published
A react component of diff text
Downloads
88
Readme
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