Skip to content

v5 without v4 .rebuild() #863

Closed
Closed
@ivansilvestre

Description

@ivansilvestre

Basically I'm using a library, react-svg-pan-zoom, that places svg depending on the dynamic coordinates we give.
In this case, the v4 .rebuild() was to place the tooltip under the coordinates that it gave when hovering over the specific svg icon.
At the moment, with v5 the tooltip is updating the hover data but the tooltip box appears outside the svg icon and is always on screen, it doesn't just appear on the hover as before with v4.

Is there any way to trigger the tooltip like .rebuild() in v4?

v4:

const handleMouseOver = (e) => {
    setData(...);
    ReactTooltip.rebuild();
};

To insert Dynamic tooltip:

componentNode.setAttribute("data-tip", "");
componentNode.setAttribute("data-for", "tooltip");

React component:

<ReactTooltip
  id="tooltip"
  place="bottom"
  type="light"
  effect="solid"
  backgroundColor="transparent"
  getContent={() => {
    return (
      <Card
        mainComponent={data?.mainComponent}
        description={data?.description}
        value={value}
        machine={`${t("Machine")} ${id}`}
      />
    );}}
 />

v5:

componentNode.setAttribute("data-content", "");
componentNode.setAttribute("data-for", "tooltip");
<ReactTooltip
  id="tooltip"
  place="bottom"
  type="light"
  effect="solid"
  backgroundColor="transparent"
  content={
      <Card
        mainComponent={data?.mainComponent}
        description={data?.description}
        value={value}
        machine={`${t("Machine")} ${id}`}
      />
    }
 />

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions