jsondiffpatch react
npm install jsondiffpatch-react- Originally forked from archived
https://github.com/hero-guo/jsondiffpatch-for-react
- Based on https://github.com/benjamine/jsondiffpatch
npm install jsondiffpatch-react
``jsx
import React from 'react';
import JsonDiffReact from 'jsondiffpatch-react';
left: PropTypes.any,
show: PropTypes.bool,
annotated: PropTypes.bool,
tips: PropTypes.string,
objectHash: PropTypes.func,
/>
`
- left (array, object, string)
- right (array, object, string)
- show (bool)
you can show/hide unchanged values
- annotated (bool)
This will render the original JSON delta in html, with annotations aside
explaining the meaning of each part. This attempts to make the JSON delta
format self-explained.
- tips (string)
Message that will displayed in case both elements are identical.
- objectHash (function)
Will be passed to _jsondiffpatch_ to improve array comparison performance, as
described
here.
Example:
`jsx`
right={right}
objectHash={(obj: any) =>
obj.id || obj._id || obj.name || JSON.stringify(obj)
}
/>
To publish to NPM, change the version number in package.json and npm publish`
once complete. Then, go to Github Releases and follow the instructions to
publish a new version there too.