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

256
Views
Texto mecanografiado: error de compilación de tipo de botón prop mecanografiado

Tengo este componente de botón:

 <button className={internalClassName} onClick={onClick ?? undefined} disabled={disabled} title={title} style={style} type={type} {...event} > {icon && <Icon icon={icon} size={iconSize} color={iconColor} />} { text } { children } </button>

donde esta el tipo

 type ButtonTypes = 'button' | 'submit' | 'reset' | undefined;

El problema es que el compilador mecanografiado se queja del tipo de prop con:

Escriba 'cadena | undefined' no se puede asignar al tipo '"submit" | "restablecer" | "botón" | indefinido'. El tipo 'cadena' no se puede asignar al tipo '"enviar" | "restablecer" | "botón" | indefinido'.

Por qué dice que es una cadena | indefinido cuando lo declaré como 'enviar' | 'restablecer' | 'botón' | ¿indefinido?

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

0

Bien, actualiza:

Parece que el evento propalador es la causa de los problemas.

 {...event}
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!