Skip to content

Commit

Permalink
Merge pull request #233 from oyeanuj/master
Browse files Browse the repository at this point in the history
Added more syntax highlighting
  • Loading branch information
wwayne authored Dec 15, 2016
2 parents 6a22405 + f560e0c commit 629d832
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import ReactTooltip from 'react-tooltip'
```

2 . Add data-tip = "your placeholder" to your element

<p data-tip="hello world">Tooltip</p>
```jsx
<p data-tip="hello world">Tooltip</p>
```

3 . Including react-tooltip component

Expand Down Expand Up @@ -122,14 +123,14 @@ method to control tooltip's behaviour in some situations
### 2. Hide tooltip when getContent returns undefined
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.

```
```jsx
<p data-tip='' data-for='test'></p>
<ReactTooltip id='test' getContent={() => { return null }}/>
```

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

```
```jsx
<p data-tip='' data-for='test'></p>
<ReactTooltip id='test'>{}</ReactTooltip>
```
Expand Down

0 comments on commit 629d832

Please sign in to comment.