Am building a React App using create-react-app so the app is server ready.
When importing a bootstrap javascript plugin such as 'affix.js', I get the error 'Uncaught ReferenceError: jQuery is not defined', and the page no longer loads.
Am importing all the modules through the index.js file since with the create-react-app it dosent seem to load the 'src' and 'link' imports from the index.html file.
Am importing the bootstrap plugin like so: import 'bootstrap/js/affix.js'
Have tried importing jquery in the following ways, at the top of the index.js file but none is working:
- import jquery from 'jquery'
- import jquery from 'jquery', window.$ = window.jQuery = jquery;
- import jQuery from 'jquery'
- import $ from 'jquery'
- import 'jquery/dist/jquery.js';
- require('./node_modules/jquery/dist/jquery.js')
Any ideas?