0

I trying to use this awesome tooltip library Popper.js

I want to use the above tooltip utility to render React Components into it. Right now, my understanding is that I can only give static html to the tooltip using title property and html set to true in the config object. I tried ReactDOMServer.renderToString but that is again creating a static markup with no lifecycle hooks or any of the React goodness. Is there any way I can inject React Components into the tooltip? Or can you please suggest some other library like this that supports flip behaviour on viewport boundaries?

PS: I don't want to use Popper.js or react-popper as I want the trigger functionality to work out of the box.

mohsinulhaq
  • 1,059
  • 1
  • 18
  • 31

2 Answers2

1

On tooltip initializing you can pass a boolean prop defining your title as an HTML

new Tooltip(reference, {html: true, title: "<div>This is a component</div>"})

See tooltip documentation

Jorgedl
  • 137
  • 3
-1

I ended up using react-popper package.

mohsinulhaq
  • 1,059
  • 1
  • 18
  • 31