I have a rails backend and a react frontend. I have implemented client-side routing with react-router-dom version 6.0.2. I am trying to include bootstrap carousel on the Home page of the application. The carousel auto-rotates perfectly fine on initial load. However, when I click a link and then return to Home, the auto-rotation stops. If I manually click either one of the rotation buttons, the auto-rotation returns.
I have only included react-router-dom and bootstrap version 5.1.3 in the app. Bootstrap works just fine. So I have ruled that out as a problem. I am also not changing anything on the bootstrap component, except class to className.
I have not uploaded any code because everything has been copy and paste.