I am looking for a React component that shows a unified git-like diff between two strings (specifically, two different JSON snippets).
Like this:

I am currently using the react-ace diff component, but that only does a side-by-side comparison and also doesn't take into account what has been added or removed.
Try either "react-diff-view" or "react-diff-viewer".
The "react-diff-viewer" is quite simple to use/implement while the "react-diff-view" offers some more advanced features.
It's up to you, here the links: https://www.npmjs.com/package/react-diff-viewer https://www.npmjs.com/package/react-diff-view
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With