You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,14 +11,16 @@ A simple and beautiful text diff viewer component made with [Diff](https://githu
11
11
12
12
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.
13
13
14
+
Check [here](https://github.com/praneshr/react-diff-viewer/tree/v2.0) for v2.0
15
+
14
16
## Install
15
17
16
18
```bash
17
-
yarn add react-diff-viewer@beta
19
+
yarn add react-diff-viewer
18
20
19
21
# or
20
22
21
-
npm i react-diff-viewer@beta
23
+
npm i react-diff-viewer
22
24
```
23
25
24
26
## Usage
@@ -64,7 +66,7 @@ class Diff extends PureComponent {
64
66
| newValue |`string`|`''`| New value as string. |
65
67
| splitView |`boolean`|`true`| Switch between `unified` and `split` view. |
66
68
| disableWordDiff |`boolean`|`false`| Show and hide word diff in a diff line. |
67
-
| compareMethod |`DiffMethod`|`DiffMethod.CHARS`| JsDiff text diff method used for diffing strings. Check out the [guide](https://github.com/praneshr/react-diff-viewer/tree/v3.0.0#text-block-diff-comparison) to use different methods. |
69
+
| compareMethod |`DiffMethod`|`DiffMethod.CHARS`| JsDiff text diff method used for diffing strings. Check out the [guide](https://github.com/praneshr/react-diff-viewer/tree/v3.0.0#text-block-diff-comparison) to use different methods. |
68
70
| hideLineNumbers |`boolean`|`false`| Show and hide line numbers. |
69
71
| renderContent |`function`|`undefined`| Render Prop API to render code in the diff viewer. Helpful for [syntax highlighting](#syntax-highlighting)|
70
72
| onLineNumberClick |`function`|`undefined`| Event handler for line number click. `(lineId: string) => void`|
@@ -77,7 +79,6 @@ class Diff extends PureComponent {
77
79
| leftTitle |`string`|`undefined`| Column title for left section of the diff in split view. This will be used as the only title in inline view. |
78
80
| rightTitle |`string`|`undefined`| Column title for right section of the diff in split view. This will be ignored in inline view. |
79
81
80
-
81
82
## Instance Methods
82
83
83
84
`resetCodeBlocks()` - Resets the expanded code blocks to it's initial state. Return `true` on successful reset and `false` during unsuccessful reset.
0 commit comments