I have a question about loading jquery as external in SharePoint Framework. I have worked through at least 20 different samples from at least as many different people and many of them MVP's. I can safely say that none of the samples is worth it's salt when it comes to explaining the concept to a beginner.
To load jquery as an external, what i have gathered is: specify jquery as external as follows in the config.js file
"externals": {
"jquery" : "https://code.jquery.com/jquery-3.2.1.min.js"
}
Once this is done, in the webpart.ts file,
import 'jquery';
declare var jQuery;
This doesn't seem to work at all. I have followed at least 20 different tutorials and samples. I can get it to work, however, if i did npm install jquery. Then it all works. However, none of the tutorials I have followed tell this step so I am not including that step either.
Can someone guide me the right direction?
Thanks
error TS2307: Cannot find module 'jquery'.