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
-
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 semicolon
and the browser console says
[(...popoverTriggerList)].map(...) is not a function
Having 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