I want to use jquery in my react app, but I keep getting this error :
'$' is not defined no-undef
I searched the issues but not one seems to specifically add jquery as a cdn in index.html.
I tried using this :
https://www.npmjs.com/package/eslint-config-react-app
Here is my .eslintrc file :
{
"extends": "react-app",
"env": {
"jquery": true
}
}
I don't want to import it, I really need it to work via index.html as a cdn
Any help with this would appreciated!
Put this at the top of your file:
const $ = window.$;
Please check out the documentation:
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#using-global-variables
Most helpful comment
Put this at the top of your file:
Please check out the documentation:
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#using-global-variables