I am using Bootstrap 5 by CDN in react. I have one component that will be using the Popover in one of the react components. So, as per the documentation, it says "You must include popper.min.js before bootstrap.js or use bootstrap.bundle.min.js / bootstrap.bundle.js which contains Popper in order for popovers to work!"
And also to initialize all popovers on a page use the given javascript code:
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-
toggle="popover"]'))
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
return new bootstrap.Popover(popoverTriggerEl)
})
But I am unable to use it in useEffect in my react component because it is returning the "bootstrap.Popover(popoverTriggerEl)" object which is undefined in my react component.
Please if anyone could guide me in this?