React-tooltip: Does tooltip work if data-tip is set by a request that can take some time?

Created on 7 Oct 2020  路  1Comment  路  Source: wwayne/react-tooltip

So.. all the tooltips work if I use it on html direct like <button data-tip="test" />

But If I use a component <Help tooltip="test" /> seems not working, why?

I import react-tooltip on my App.js.
Also App.js got the: <ReactTooltip place="bottom" effect="solid" />

My component Help (that one that not work tooltip) is the following:

const tooltip = this.props.tooltip || "Tooltip"; <div className="Help" data-tip={tooltip}> {children} </Help>

But the Help component is inside a request on other pages and It can take some seconds to spawn. Why is not working? The others tooltips works fine.

Thanks.

EDIT: I tested ReactToolTip.rebuild but doesn't work either.
EDIT2: I use StoryBook to make the documention and the component Help works nice with the tooltip there. Why doesn't work on my other pages? :/

Most helpful comment

I fixed it by adding the Import from ReactTooltip on each page and using the Rebuild option after the request complete.

ReactTooltip.rebuild();

>All comments

I fixed it by adding the Import from ReactTooltip on each page and using the Rebuild option after the request complete.

ReactTooltip.rebuild();

Was this page helpful?
0 / 5 - 0 ratings