function ReactTooltip(props) { _classCallCheck(this, ReactTooltip); var _this = _possibleConstructorReturn(this, (ReactTooltip.__proto__ || Object.getPrototypeOf(ReactTooltip)).call(this, props)); _this.state = { place: 'top', // Direction of tooltip type: 'dark', // Color theme of tooltip effect: 'float', // float or fixed show: false, border: false, placeholder: '', offset: {}, extraClass: '', html: false, delayHide: 0, delayShow: 0, event: props.event || null, eventOff: props.eventOff || null, currentEvent: null, // Current mouse event currentTarget: null, // Current target of mouse event ariaProps: (0, _aria.parseAria)(props), // aria- and role attributes isEmptyTip: false, disable: false }; _this.bind(['showTooltip', 'updateTooltip', 'hideTooltip', 'globalRebuild', 'globalShow', 'globalHide', 'onWindowResize']); _this.mount = true; _this.delayShowLoop = null; _this.delayHideLoop = null; _this.intervalUpdateContent = null; return _this; }
n/a
hide = function (target) { dispatchGlobalEvent(_constant2.default.GLOBAL.HIDE, { target: target }); }
...
##### Note:
1. **data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
2. **data-for** corresponds to the **id** of `<ReactTooltip />`
3. When using react component as tooltip, you can have many `<ReactTooltip />` in a page but they should have different
**id**s
## Static Methods
### ReactTooltip.hide(target)
> Hide the tooltip manually, the target is optional, if no target passed in, all existing tooltips will be hidden
```js
import {findDOMNode} from 'react-dom'
import ReactTooltip from 'react-tooltip'
...
propTypes.afterShow = function () { [native code] }
n/a
propTypes.children = function () { [native code] }
n/a
propTypes.delayHide = function () { [native code] }
n/a
propTypes.multiline = function () { [native code] }
n/a
propTypes.offset = function () { [native code] }
n/a
propTypes.place = function () { [native code] }
n/a
rebuild = function () { dispatchGlobalEvent(_constant2.default.GLOBAL.REBUILD); }
...
import ReactTooltip from 'react-tooltip'
<p ref='foo' data-tip='tooltip'></p>
<button onClick={() => { ReactTooltip.hide(findDOMNode(this.refs.foo)) }}></button>
<ReactTooltip />
```
### ReactTooltip.rebuild()
> Rebinding all tooltips
### ReactTooltip.show(target)
> Show specific tooltip manually, for example:
...
show = function (target) { dispatchGlobalEvent(_constant2.default.GLOBAL.SHOW, { target: target }); }
...
<ReactTooltip />
```
### ReactTooltip.rebuild()
> Rebinding all tooltips
### ReactTooltip.show(target)
> Show specific tooltip manually, for example:
```js
import {findDOMNode} from 'react-dom'
import ReactTooltip from 'react-tooltip'
...
afterHide = function () { [native code] }
n/a
afterShow = function () { [native code] }
n/a
border = function () { [native code] }
n/a
children = function () { [native code] }
n/a
class = function () { [native code] }
n/a
className = function () { [native code] }
n/a
delayHide = function () { [native code] }
n/a
delayShow = function () { [native code] }
n/a
disable = function () { [native code] }
n/a
effect = function () { [native code] }
n/a
event = function () { [native code] }
n/a
eventOff = function () { [native code] }
n/a
getContent = function () { [native code] }
n/a
globalEventOff = function () { [native code] }
n/a
html = function () { [native code] }
n/a
id = function () { [native code] }
n/a
insecure = function () { [native code] }
n/a
isCapture = function () { [native code] }
n/a
multiline = function () { [native code] }
n/a
offset = function () { [native code] }
n/a
place = function () { [native code] }
n/a
resizeHide = function () { [native code] }
n/a
scrollHide = function () { [native code] }
n/a
type = function () { [native code] }
n/a
watchWindow = function () { [native code] }
n/a
wrapper = function () { [native code] }
n/a
afterShow = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a
children = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a
delayHide = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a
multiline = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a
offset = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a
place = function () { [native code] }
n/a
isRequired = function () { [native code] }
n/a