I'm trying to use bootstrap in my react app, but it gives me aError: Bootstrap's JavaScript requires jQuery
. I have imported jquery and have tried tried the following from other posts:
import $ from 'jquery';
window.jQuery = $;
window.$ = $;
global.jQuery = $;
However, I still get the not defined
error.
The only way to fix this is to put
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
into index.html
is there a way to export jquery or have bootstrap be able to detect/read it?
I call my bootstrap via
import bootstrap from 'bootstrap'