Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My bootstrap carousel is not working properly in react

I don’t know why my carousel’s not working properly, can anybody tell me how to fix this issue.
My codesandbox link :- https://codesandbox.io/s/nice-heyrovsky-8yucf?file=/src/Prompts.jsx

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You are creating carousel-inner multiple times but in reality you only need to render that one time and render carousel-items multiple times

I refactored your code a bit too so it only talks to the relevant dom elements

Also, I somewhat agree and disagree with christ here. Yes you should opt for react-boostrap library for this kind of stuff because they provide components for every item however if you ever use it then do explore the rendered version of it on the browser and then you will realize that its the same as a simple bootstrap library with same class names etc. But its mostly depends on how you use any library.

Anyway, I hope this codesandbox helped you if didn’t then let me know. Happy coding

https://codesandbox.io/s/suspicious-tu-55u2h?file=/src/Prompts.jsx

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading