score:12

Accepted answer

try adding bootstrap.js in your imports after you import jquery:

import "../node_modules/jquery/dist/jquery.min.js";
import "../node_modules/bootstrap/dist/js/bootstrap.min.js";

score:0

if it is bootstrap v3, maybe try to change class navbar-toggler to navbar-toggle.

on npm page bootstrap 3.3.7 is latest version..

score:6

simply import bootstrap.min.js after bootstrap.min.css

import "bootstrap/dist/js/bootstrap.min.js";

score:7

the best solution for me was to import only the bootstrap collapse.js script in the navbar component to prevent mixing js scripts.

include this at the top of your navbar.jsx component:

import "bootstrap/js/src/collapse.js";


Related Query

More Query from same tag