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

180
Views
¿Cómo importar la biblioteca js externa (cdn) para reaccionar al proyecto mecanografiado?

Necesito importar https://youglish.com/public/emb/widget.js a mi proyecto React y usar su YG como función. Básicamente, necesito este widget en mi aplicación web React. Pude usar su etiqueta. pero necesito obtener la función YG en la aplicación React.

también puede considerar https://youglish.com/api/doc/js-api

¡Métodos que he probado hasta ahora!

1.

 import 'https://youglish.com/public/emb/widget.js' const Widget = () => { const widget = new YG.Widget("widget-1"); widget.fetch("courage", "english"); }; return ( <> <Widget /> .....
 import YG from "YG"; useEffect(() => { const script = document.createElement("script"); script.src = "https://youglish.com/public/emb/widget.js"; script.async = true; document.body.appendChild(script); }, []); const Widget = () => { const widget = new YG.Widget("widget-1"); widget.fetch("courage", "english"); }; return ( <> <Widget /> ..... added in index.html dody <script async src="https://youglish.com/public/emb/widget.js" charset="utf-8" ></script> errors: Failed to compile. ./src/App.tsx Module not found: Can't resolve 'YG' in '/Users/.../Documents/Apps/Projects/.../src'
about 4 years ago · Juan Pablo Isaza
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!