Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
how to use jquery from cdn in react's component

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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 });
    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!