Skip to content

Commit 7aa2a17

Browse files
committed
Updating Readme
1 parent 4408bcd commit 7aa2a17

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ class Diff extends PureComponent {
5757
```
5858

5959
## Props
60-
|Prop |Type |Default |Description |
61-
|------------------|-------------|----------------|----------------------------------------------|
62-
|oldValue |`string` |`''` |Old value as sting. |
63-
|newVlaue |`string` |`''` |New value as sting. |
60+
|Prop |Type |Default |Description |
61+
|------------------|---------------|--------------|----------------------------------------------|
62+
|oldValue |`string` |`''` |Old value as string. |
63+
|newVlaue |`string` |`''` |New value as string. |
6464
|splitView |`boolean` |`true` |Switch between `unified` and `split` view. |
65-
|disableWordDiff |`boolean` |`false` |Do not show word diff in a diff line. |
65+
|disableWordDiff |`boolean` |`false` |Show and hide word diff in a diff line. |
6666
|renderContent |`function` |`undefined` |Render Prop API to render code in the diff viewer. Helpful for [syntax highlighting](#syntax-highlighting) |
6767
|onLineNumberClick |`function` |`undefined` |Event handler for line number click. `(lineId: string) => void` |
68-
|hightlightLines |`array[string]`|`[]` |List of lines to be highlighted. Works together with `onLineNumberClick`. Line number are prefixed with `L` and `R` for the line numbers on the left and right section of the diff viewer. Example, `L-20` means 20th line in the left pane. To highlight a range of line numbers, pass the prefixed line number as an array. For example, `[L-2, L-3, L-4, L-5]` will highlight the lines `2-5` in the left pane. |
68+
|hightlightLines |`array[string]`|`[]` |List of lines to be highlighted. Works together with `onLineNumberClick`. Line number are prefixed with `L` and `R` for the left and right section of the diff viewer, respectively. For example, `L-20` means 20th line in the left pane. To highlight a range of line numbers, pass the prefixed line number as an array. For example, `[L-2, L-3, L-4, L-5]` will highlight the lines `2-5` in the left pane. |
6969
|styles |`object` |`{}` |To override style variables and styles. Learn more about [overriding styles](#overriding-styles) |
7070

7171
## Syntax Highlighting
7272

73-
Syntax highlighting is a bit tricky when combined with diff. But, React Diff Viewer provides a simple render prop API to handle syntax highlighting. Use `renderContent(content: string) => JSX.Element` and your favorite syntax highlighting library to acheive this.
73+
Syntax highlighting is a bit tricky when combined with diff. Here, React Diff Viewer provides a simple render prop API to handle syntax highlighting. Use `renderContent(content: string) => JSX.Element` and your favorite syntax highlighting library to acheive this.
7474

7575
An example using [Prism JS](https://prismjs.com)
7676

@@ -166,7 +166,7 @@ const defaultStyles = {
166166
}
167167
```
168168

169-
To override any style, simple pass the new style object to the `styles` prop. New style will be computed using `Object.assign(default, override)`.
169+
To override any style, just pass the new style object to the `styles` prop. New style will be computed using `Object.assign(default, override)`.
170170

171171
For keys other than `variables`, the value can either be an object or string interpolation. Emotion's dynamic styles are not yet supported.
172172

examples/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Example extends React.Component<{}, IExampleState> {
4040

4141
onChange = () => this.setState({ splitView: !this.state.splitView })
4242

43-
onLanguageChange = (e: any) => this.setState({ language: e.target.value })
43+
onLanguageChange = (e: any) => this.setState({ language: e.target.value, highlightLine: [] })
4444

4545
onLineNumberClick = (id: string, e: React.MouseEvent<HTMLTableCellElement>) => {
4646
let highlightLine = [id]

0 commit comments

Comments
 (0)