I am using Jquery with CDN in react's index.html file.. Unfortunatelly, this is how it should be and can't install react separately with yarn.
How can I use now $ in React's components ?
I can't do import $ from Jquery. and if i use $ directly, it's not defined.
Any idea ?
I also tried useEffect, but in that, $ is not defined at first.
have you tried with npm or yarn.
npm install jquery
import $ from "jquery"
I have tried it and its working fine.
if ($(".enclosing_container ").length) {
$(".enclosing_container div").remove();
} else {
$(".main-row div").remove();
this.setState({ focusUI: false });
}