Skip to content

Commit 629d832

Browse files
authored
Merge pull request #233 from oyeanuj/master
Added more syntax highlighting
2 parents 6a22405 + f560e0c commit 629d832

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import ReactTooltip from 'react-tooltip'
2323
```
2424

2525
2 . Add data-tip = "your placeholder" to your element
26-
27-
<p data-tip="hello world">Tooltip</p>
26+
```jsx
27+
<p data-tip="hello world">Tooltip</p>
28+
```
2829

2930
3 . Including react-tooltip component
3031

@@ -122,14 +123,14 @@ method to control tooltip's behaviour in some situations
122123
### 2. Hide tooltip when getContent returns undefined
123124
When you set `getContent={() => { return }}` you will find the tooltip will dispaly `true`, that's because React will set the value of data-* to be 'true' automatically if there is no value to be set. So you have to set `data-tip=''` in this situaction.
124125

125-
```
126+
```jsx
126127
<p data-tip='' data-for='test'></p>
127128
<ReactTooltip id='test' getContent={() => { return null }}/>
128129
```
129130

130131
Same for empty children, if you don't want show the tooltip when the children is empty
131132

132-
```
133+
```jsx
133134
<p data-tip='' data-for='test'></p>
134135
<ReactTooltip id='test'>{}</ReactTooltip>
135136
```

0 commit comments

Comments
 (0)