First of all I'm still a newbie in web development. Okay, now to the question. I have these imports:
import $ from 'jquery';
window.jQuery = $;
window.$ = $;
global.jQuery = $;
import './assets/js/waves';
How do I properly import an external javascript to reactjs if my external javascript requires jquery?
Because based on what these guys have said:
my imports will be hoisted, which results in my external "./assets/js/waves" js causing an error.
Uncaught ReferenceError: $ is not defined?
Thanks in advance!
Then you have a reference of
jQuery
and you may do with it what you like, for instance: