Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

330
Vistas
How to call a Javascript function from TypeScript in React

I am building a React application in Typescript. In my React application, my Typescript code need to call a JavaScript function.

so I try the answer from here Call external Javascript function from react typescript components And I did

  1. Create a Myutil.js file which contains a JS function:

    export default { function myTestFunction(arg1, arg2) { ... return 1; } };

  2. In my Typscript code I call the function like let returnValue = myTestFunction("abc", "def");

But when I compile it, I get error saying

myutil.js(2,14): error TS1005: Build:':' expected.

And column 14 of line 2 is the beginning of the function name myTestFunction

 function myTestFunction
          ^
          |
         14

Can you please tell me what am I missing?

Thank you.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda