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

114
Views
ReactJS: propiedad esperada taquigrafía objeto-taquigrafía

Tengo un formulario con un envío. Cuando se hace clic, creo un objeto para enviar estos datos a POST.

Entonces tengo saveEntity const:

 const saveEntity = (event, errors, values) => { // this is the const that is signed as error: const valoreComune: any = comCod ? { comCod: { comCod: comCod } } : personEntity.comCod ? { comCod: { comCod: personEntity.comCod.comCod } } : { comCod: null }; //.... const entity = { // this is the object that I pass to post // .... valoreComune } }

Necesito recrear esta estructura de objeto:

 comCod: { comCod: value }

o

 comCod: null

Ahora recibo este error:

Propiedad esperada taquigrafía objeto-taquigrafía

Ahora generalmente resuelvo escribir directamente de esta manera:

 const entity = { valoreComune }

pero no funciona ¿Como lo puedo hacer?

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

0

Debe usar la sintaxis abreviada de objetos para esta parte:

 { comCod: { comCod: comCod } }

Que se escribe así:

 { comCod: { comCod } }
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!