Skip to content

Commit 41fd9de

Browse files
authored
Update README.md
1 parent a63985a commit 41fd9de

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

README.md

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ class Diff extends PureComponent {
7878
|newValue |`string` |`''` |New value as string. |
7979
|splitView |`boolean` |`true` |Switch between `unified` and `split` view. |
8080
|disableWordDiff |`boolean` |`false` |Show and hide word diff in a diff line. |
81-
|compareMethod |`string` |`'diffChars'` |JsDiff text diff method from https://github.com/kpdecker/jsdiff/tree/v4.0.1#api |
8281
|hideLineNumbers |`boolean` |`false` |Show and hide line numbers. |
8382
|renderContent |`function` |`undefined` |Render Prop API to render code in the diff viewer. Helpful for [syntax highlighting](#syntax-highlighting) |
8483
|onLineNumberClick |`function` |`undefined` |Event handler for line number click. `(lineId: string) => void` |
@@ -149,44 +148,6 @@ class Diff extends PureComponent {
149148
}
150149
```
151150

152-
## Text block diff comparison
153-
154-
Different styles of text block diffing are possible by using the enums corresponding to various v4.0.1 JsDiff text block method names ([learn more](https://github.com/kpdecker/jsdiff/tree/v4.0.1#api)).
155-
156-
```javascript
157-
import React, { PureComponent } from 'react'
158-
import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer'
159-
160-
const oldCode = `
161-
{
162-
"name": "Original name",
163-
"description": null
164-
}
165-
`
166-
const newCode = `
167-
{
168-
"name": "My updated name",
169-
"description": "Brand new description",
170-
"status": "running"
171-
}
172-
`
173-
174-
class Diff extends PureComponent {
175-
render = () => {
176-
return (
177-
<ReactDiffViewer
178-
oldValue={oldCode}
179-
newValue={newCode}
180-
compareMethod={DiffMethod.WORDS}
181-
splitView={true}
182-
renderContent={this.highlightSyntax}
183-
/>
184-
)
185-
}
186-
}
187-
```
188-
189-
190151
## Overriding Styles
191152

192153
React Diff Viewer uses [emotion](https://emotion.sh/) for styling. It also offers a simple way to override styles and style variables.

0 commit comments

Comments
 (0)