react-tippy
react-tippy copied to clipboard
Post a simple HTML example for `withTooltip`?
Trying this:
Produces this error:
... can you post something in the documentation about how to use html with withTooltip?
Thank you!!
Muchos kudos. :-)
Try like this:
const a = withTooltip(AerialMap, {
title: 'blabla',
followCursor: true,
html: <div>5</div>, // without curly brackets
});
Thank @amandapouget for your question.
html accept every react component, thus, you just need to pass them normally like
// pass directly
html: <div>test</div>
html: (<div>test</div>) <- they are both the same
// pass via variable
a = <div>test</div>
html: a
// pass via function call
A = () => <div>test</div>
html: <A />
html: A()
and FYI, using curly bracket is incorrect, as incorrect is for creating object not react component.