I mean, you could stringify them both and check if they are equal or not… would be a quick and dirty way. Answer from Thalimet on reddit.com
GitHub
github.com › 5SSS › react-json-view-compare
GitHub - 5SSS/react-json-view-compare: compare json data,json viewer(demo:https://codesandbox.io/s/jovial-meadow-v17pw)
import ReactJsonViewCompare from 'react-json-view-compare'; const oldData = { name: 'super', age: 18, task: [ { name: 'eat', time: '09:00' }, { name: 'work', time: '10:00' }, { name: 'sleep', time: '22:00' } ] }; const newData = { name: 'coolapt', age: 20, task: [ { name: 'eat', time: '09:00' }, { name: 'work', time: '10:00' }, { name: 'sleep', time: '23:00' }, { name: 'running', time: '08:00' } ] }; function App() { return <ReactJsonViewCompare oldData={oldData} newData={newData} />; } ReactDOM.render(<App />, document.getElementById('root'));
Starred by 45 users
Forked by 15 users
Languages JavaScript 81.5% | CSS 16.8% | HTML 1.7% | JavaScript 81.5% | CSS 16.8% | HTML 1.7%
npm
npmjs.com › package › react-json-view-compare
react-json-view-compare - npm
React json compare view plugin, supports expansion and hiding.use react hooks.. Latest version: 2.0.2, last published: 3 years ago. Start using react-json-view-compare in your project by running `npm i react-json-view-compare`. There are 7 other projects in the npm registry using react-json-view-compare.
» npm install react-json-view-compare
Published Mar 30, 2023
Version 2.0.2
Author coolapt
reactjs - How do I compare and render the data between several JSON maps in React? - Stack Overflow
Use json diff viewer and make sure that you use stringfy(jsonstr, null, 2) to format the json first. It'll make much comparison faster and clearner. More on stackoverflow.com
Is there a library that allows to easily do diffchecks between two json?
I mean, you could stringify them both and check if they are equal or not… would be a quick and dirty way. More on reddit.com
Need a component to compare json changes
I recently used react-diff-viewer-continued. For text rather than JSON but it should work fine, especially if the JSON string is formatted. I believe you need to install with the @next dist tag for react 19 support. More on reddit.com
React Tree View for Json object?
I use this: https://www.npmjs.com/package/react-json-view More on reddit.com
CodeSandbox
codesandbox.io › examples › package › react-json-view-compare
react-json-view-compare examples - CodeSandbox
Use this online react-json-view-compare playground to view and fork react-json-view-compare example apps and templates on CodeSandbox.
Stack Overflow
stackoverflow.com › questions › 70610973 › how-do-i-compare-and-render-the-data-between-several-json-maps-in-react
reactjs - How do I compare and render the data between several JSON maps in React? - Stack Overflow
Use json diff viewer and make sure that you use stringfy(jsonstr, null, 2) to format the json first. It'll make much comparison faster and clearner.
NPM Compare
npm-compare.com › react-json-view
react-json-view | Compare Similar npm Packages
Comprehensive comparison of react-json-view npm packages, including features, npm download trends, ecosystem, popularity, and performance.
Reddit
reddit.com › r/reactjs › is there a library that allows to easily do diffchecks between two json?
r/reactjs on Reddit: Is there a library that allows to easily do diffchecks between two json?
October 13, 2022 -
I am wondering if there's something that allows you to easily display differences between two json like on diffchecker.com. Is there a library that allows you to easily do that?
Runkit
npm.runkit.com › react-json-view-compare
RunKit + npm: react-json-view-compare
require("react/package.json"); // react is a peer dependency. require("react-dom/package.json"); // react-dom is a peer dependency. var reactJsonViewCompare = require("react-json-view-compare")
React.js Examples
reactjsexample.com › a-better-json-differ-viewer-support-lcs-diff-for-arrays-and-recognise-some-changes-as-modification-instead-of-removeadd
A better JSON differ & viewer, support LCS diff for arrays and recognise some changes as modification apart from simple remove+add
February 11, 2022 - import { Viewer } from 'json-diff-kit'; import type { DiffResult } from 'json-diff-kit'; import 'json-diff-kit/dist/viewer.css'; interface PageProps { diff: [DiffResult[], DiffResult[]]; } const Page: React.FC<PageProps> = props => { return ( <Viewer diff={props.diff} // required indent={4} // default `2` lineNumbers={true} // default `false` /> ); }; The result is here: Please check the demo pages.
GitHub
github.com › 5SSS › react-json-view-compare › issues
Issues · 5SSS/react-json-view-compare
compare json data,json viewer(demo:https://codesandbox.io/s/jovial-meadow-v17pw) - 5SSS/react-json-view-compare
Author 5SSS
GitHub
github.com › utkuakyuz › virtual-react-json-diff
GitHub - utkuakyuz/virtual-react-json-diff: A lightweight diff viewer for JSON files in React applications · GitHub
A high-performance React JSON diff viewer for large, real-world JSON data. Built to handle tens of thousands of lines without freezing the UI, it uses virtualized rendering to stay fast and responsive even in production-scale scenarios.
Starred by 15 users
Forked by 2 users
Languages TypeScript 85.1% | CSS 12.5% | JavaScript 2.4%
GitHub
github.com › shripatil70 › json-diff-viewer
GitHub - shripatil70/json-diff-viewer: 🧩 JSON Diff Viewer — A lightweight React + TypeScript tool to visually compare two JSON files side-by-side with color-coded differences, live updates, dark/light mode, and zero UI libraries.
🧩 JSON Diff Viewer — A lightweight React + TypeScript tool to visually compare two JSON files side-by-side with color-coded differences, live updates, dark/light mode, and zero UI libraries. - shripatil70/json-diff-viewer
Author shripatil70
GitHub
github.com › udamir › api-diff-viewer
GitHub - udamir/api-diff-viewer: React component to view difference between two Json based API documents · GitHub
'json' : 'yaml') } // Toggle dark mode document.getElementById('toggle-dark')!.onclick = () => { viewer.setTheme({ dark: !viewer.isDark() }) } const viewer = createDiffViewer(container, specV1, specV2) // Later, compare different versions viewer.update(specV2, specV3)
Starred by 45 users
Forked by 2 users
Languages TypeScript 98.1% | CSS 1.8% | JavaScript 0.1%
Reddit
reddit.com › r/reactjs › need a component to compare json changes
r/reactjs on Reddit: Need a component to compare json changes
February 12, 2025 -
I'm looking for a react component that compares json documents passed in as strings. The input would be the two json strings and the component would render the diff like a GitHub pr files changed UI. I was using ReactDiffViewer but it is not compatible with react 18.
Top answer 1 of 2
2
I recently used react-diff-viewer-continued. For text rather than JSON but it should work fine, especially if the JSON string is formatted. I believe you need to install with the @next dist tag for react 19 support.
2 of 2
1
Hey check this React Component, it uses json-diff-kit for diff methods and it works pretty well especially for deep array comparison. But however there are no similar package that has minimap, virtual scroll or search ability. No other library provided me correct outputs for my specific JSON objects including several indented arrays. https://www.npmjs.com/package/virtual-react-json-diff I am still developing for new features, this is open source and I am open for any contribution. I will apply new themes soon.
Npm
npm.io › package › react-json-view-compare
React-json-view-compare NPM | npm.io
import ReactJsonViewCompare from 'react-json-view-compare'; const oldData = { name: 'super', age: 18, task: [ { name: 'eat', time: '09:00' }, { name: 'work', time: '10:00' }, { name: 'sleep', time: '22:00' } ] }; const newData = { name: 'coolapt', age: 20, task: [ { name: 'eat', time: '09:00' }, { name: 'work', time: '10:00' }, { name: 'sleep', time: '23:00' }, { name: 'running', time: '08:00' } ] }; function App() { return <ReactJsonViewCompare oldData={oldData} newData={newData} />; } ReactDOM.render(<App />, document.getElementById('root'));
GitHub
github.com › relex › json-diff-react
GitHub - relex/json-diff-react: A React.js component that renders a structural diff of two JSON values · GitHub
A React.js component that renders a structural diff of two JSON values. Written in TypeScript except for the JavaScript code inherited from the original json-diff library.
Starred by 8 users
Forked by 2 users
Languages TypeScript 55.5% | JavaScript 39.0% | Shell 4.6%