Code to initialize Popover gives error in console #37458
Unanswered
bajahranks
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Bootstrap 5.2 documentation says that you need to initialize Popover with the following code
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="popover"]')const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))However my IDE gives this error:
The expression is not callable. If this is not supposed to be a call, check for a missing semicolonand the browser console says
[(...popoverTriggerList)].map(...) is not a functionHaving said that the code works, but is there another to write the code that doesn't give these errors?
Beta Was this translation helpful? Give feedback.
All reactions