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

Answer from Jamil Mammri on Stack Overflow
🌐
React Diff Viewer
praneshravi.in › react-diff-viewer
React Diff Viewer
A simple and beautiful text diff viewer for React
🌐
GitHub
github.com › praneshr › react-diff-viewer
GitHub - praneshr/react-diff-viewer: A simple and beautiful text diff viewer component made with Diff and React. · GitHub
Inspired from Github diff viewer, it includes features like split view, inline view, word diff, line highlight and more. It is highly customizable and it supports almost all languages.
Starred by 1.6K users
Forked by 311 users
Languages   TypeScript 96.3% | JavaScript 3.1% | Shell 0.6%
Discussions

React 18?
There was an error while loading. Please reload this page More on github.com
🌐 github.com
4
August 29, 2022
reactjs - React library to display unified diff between two strings - Stack Overflow
react-diff-viewer-continued might be what you are looking for since 'react-diff-view' is no longer having updates and is not compactable for react 18^. More on stackoverflow.com
🌐 stackoverflow.com
React-Diff-View
I tried other packages too like 'react-diff-viewer' but they crash if the string size is too large More on reddit.com
🌐 r/learnreactjs
1
1
March 1, 2021
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
🌐 r/reactjs
27
16
October 13, 2022
🌐
npm
npmjs.com › package › react-diff-view
react-diff-view - npm
July 24, 2025 - A git diff component to consume the git unified diff output.. Latest version: 3.3.2, last published: 8 months ago. Start using react-diff-view in your project by running `npm i react-diff-view`. There are 52 other projects in the npm registry using react-diff-view.
      » npm install react-diff-view
    
Published   Jul 24, 2025
Version   3.3.2
Author   otakustay
🌐
CodeSandbox
codesandbox.io › examples › package › react-diff-viewer
react-diff-viewer examples - CodeSandbox
AboutA simple and beautiful text diff viewer component made with diff and React244,570Weekly Downloads
🌐
npm
npmjs.com › package › react-diff-viewer-continued
react-diff-viewer-continued - npm
Continuation of a simple and beautiful text diff viewer component made with diff and React. Latest version: 4.2.0, last published: a day ago. Start using react-diff-viewer-continued in your project by running `npm i react-diff-viewer-continued`. ...
      » npm install react-diff-viewer-continued
    
🌐
GitHub
github.com › praneshr › react-diff-viewer › issues › 166
React 18? · Issue #166 · praneshr/react-diff-viewer
August 29, 2022 - praneshr / react-diff-viewer Public · There was an error while loading. Please reload this page. Notifications · You must be signed in to change notification settings · Fork 314 · Star 1.6k · New issueCopy link · New issueCopy link · Open · Open · React 18?#166 ·
Author   jchambers-ln
🌐
npm
npmjs.com › package › @alexbruf › react-diff-viewer
@alexbruf/react-diff-viewer - npm
April 30, 2025 - It is highly customizable and it supports almost all languages. React 18/19 Compatible · This version of @alexbruf/react-diff-viewer is compatible with React v18 and v19, utilizing functional components and hooks internally.
      » npm install @alexbruf/react-diff-viewer
    
Published   Apr 30, 2025
Version   3.1.5
Author   Alex Brufsky
Find elsewhere
🌐
Mrwangjusttodo
mrwangjusttodo.github.io › git-diff-view
Git Diff View - High-Performance Diff Component for React, Vue, Solid & Svelte
A feature-rich, high-performance diff view component for React, Vue, Solid, and Svelte. GitHub-style UI with syntax highlighting, split/unified views, and SSR support.
🌐
npm
npmjs.com › package › react-diff-viewer
react-diff-viewer - npm
May 22, 2020 - Inspired from Github diff viewer, it includes features like split view, inline view, word diff, line highlight and more. It is highly customizable and it supports almost all languages.
      » npm install react-diff-viewer
    
Published   May 22, 2020
Version   3.1.1
Author   Pranesh Ravi
🌐
Kyle-peacock
kyle-peacock.com › blog › react-diff
React Diff Viewer | Kai Peacock's website
May 23, 2020 - Technical and non-technical posts from Kai's blog. This blog is a bit of a digital garden.
🌐
UNPKG
unpkg.com › browse › react-diff-viewer@3.1.0 › package.json
react-diff-viewer/package.json
A simple and beautiful text diff viewer component made with diff and React · github.com/praneshr/react-diff-viewer
🌐
GitHub
github.com › aeolun › react-diff-viewer-continued › issues
Issues · aeolun/react-diff-viewer-continued
A simple and beautiful text diff viewer component made with Diff and React. - Aeolun/react-diff-viewer-continued
Author   Aeolun
🌐
CodeSandbox
codesandbox.io › examples › package › react-diff-viewer-continued
react-diff-viewer-continued examples - CodeSandbox
AboutContinuation of a simple and beautiful text diff viewer component made with diff and React558,855Weekly Downloads
🌐
Reddit
reddit.com › r/learnreactjs › react-diff-view
r/learnreactjs on Reddit: React-Diff-View
March 1, 2021 -

Hey reddit! My first post on this subreddit here. I'm trying to generate a github style diff between 2 strings containing code on react. I found a package on github otakustay/react-diff-view but i'm confused as to how to use this package. react-diff-view

The example given in the readme uses a parameter 'diffText' but then doesn't provide any info as to what that variable is.

Would love the help!

🌐
DhiWise
dhiwise.com › post › exploring-the-power-of-react-diff-viewer-comprehensive-guide
Exploring the Benefits of React Diff Viewer for Code ...
February 15, 2024 - React Diff Viewer is designed to render differences between two pieces of code or text, highlighting the changes visually appealingly. It supports unified and split views, allowing developers to choose their preferred way of displaying diffs.
🌐
GitHub
github.com › keploy › react-diff-viewer › blob › master › package.json
react-diff-viewer/package.json at master · keploy/react-diff-viewer
"description": "Continuation of a simple and beautiful text diff viewer component made with diff and React",
Author   keploy
🌐
Npm
npm.io › search › keyword:diff-viewer
Diff-viewer | npm.io
A simple and beautiful text diff viewer component made with diff and React