Generate Github like diff result in react.
npm install qtl-react-gh-like-diffsh
yarn add react-gh-like-diff
or
npm install react-gh-like-diff --save
`
Configuration
react-gh-like-diff is based on diff2html. The default configuration:
`js
const defaultOptions = {
originalFileName: 'Unknown-File-Name',
updatedFileName: 'Unknown-File-Name',
inputFormat: 'diff',
outputFormat: 'side-by-side',
showFiles: false,
matching: 'none',
matchWordsThreshold: 0.25,
matchingMaxComparisons: 2500
};
`
You can custom options for you want, just pass options as props. The configuration you can reference here. :mag_right:
Props
$3
> string | defaults to ''
Passing past string as past prop with current prop for comparison.
$3
> string | defaults to ''
Passing current string as current prop with past prop for comparison.
$3
> string | defaults to ''
Passing unified diff as prop to generate pretty HTML.
$3
> object` | optional, See here