In jQuery we usually trigger a popover like below :
$(".font-family").popover({
html: true,
animation: true,
placement: 'auto top'
});
component :
this.state.data.map((element, index) => {
return (
<div key={index} style={{ "fontFamily":element.value }} data-fontFamily={element.value} id={element.name} data-content={element.message}
ref={(ref) => this.fontFamily = ref}
className = ".font-family"
>
{element.name}
</div>
);
});
but I want to implement it in react, I know call those codes in ComponentDidMount() will work, but I want to do it in react way.
$(this.refs.fontFamily).popover({
react: true
});
by using this it works but I'm sick of using $ to trigger popover in react.
note : I don't want to add extra libraries like react-bootstrap for this case and need a React-based solution.
Any ideas would be helpful.