alexkatz / react-tiny-popover

A simple and highly customizable popover react higher order component with no other dependencies! Typescript friendly.
MIT License
454 stars 121 forks source link

Could the Popover be controlled by a click event? #149

Closed baba43 closed 2 years ago

baba43 commented 2 years ago

I would like to add a button with popover to a Fullcallender.

Fullcalendar provides a simple mechanism for adding buttons in general:

myCustomButton: {
  text: 'custom!',
  click: function(clickEvent, buttonElement) {
    alert('clicked the custom button!');
  }
}

Sadly, this way we can only provide onClick handlers but no HTML and also no React components.

That is why I'd like to ask if and how I might integrate react-tiny-popover in a situation like this?

afraser commented 2 years ago

this library is built on react so it probably doesn't make sense for your use case unless you plan on adopting react as well

alexkatz commented 2 years ago

It looks like FullCallendar supports JSX content injection, which should allow you to use react-tiny-popover normally. If you try this out and experience some difficulty, feel free to reopen this issue. Thanks!