Replies: 1 comment 1 reply
-
|
Not sure about that specific issue but if you're using React it might be better to use https://react-bootstrap.github.io/ for the JS. Have you tried/considered that? |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I have a react app where I import the bootstrap bundle in the
index.js, but then need to manually create aCarouselinstance in a component file (Reduced example here: https://codesandbox.io/p/sandbox/wonderful-sutherland-6lyppw).You can see that the dropdown works, but if you uncomment the import in
Carousel.jsx, it no longer does. This happens for trying to import anything from bootstrap (Alert,Popover, etc.) and affects more than just dropdowns (e.g. collapse), so I am assuming this is a problem that comes from importing the bootstrap JS multiple times in different places.In fact, I can avoid this problem by doing
but something about storing bootstrap on
windowbothers me. Aside from that, I should be able to import an individual class from bootstrap without re-running whatever code deals with thedata-bs-attributes. Is there a better way to make this work?Beta Was this translation helpful? Give feedback.
All reactions