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

283
Vistas
Obtención del objeto SyntheticBaseEvent en lugar del evento simple al usar React

Tengo este código React muy simple:

 const onSelectTournament = (e) => { console.log(e); };

Y este HTML:

 <div onClick={onSelectTournament}></div>

Pero en la consola, en lugar de obtener el objeto Event , obtengo este objeto infernal:

 SyntheticBaseEvent {_reactName: 'onClick', _targetInst: null, type: 'click', nativeEvent: PointerEvent, target: div.tournamentsBoxDescription, …} altKey: false bubbles: true button: 0 buttons: 0 cancelable: true clientX: 382 clientY: 269 ctrlKey: false currentTarget: null defaultPrevented: false detail: 1 eventPhase: 3 getModifierState: ƒ modifierStateGetter(keyArg) isDefaultPrevented: ƒ functionThatReturnsFalse() isPropagationStopped: ƒ functionThatReturnsFalse() isTrusted: true metaKey: false movementX: 0 movementY: 0 nativeEvent: PointerEvent {isTrusted: true, delegateTarget: document, pointerId: 1, width: 1, height: 1, …} pageX: 382 pageY: 269 relatedTarget: null screenX: 382 screenY: 373 shiftKey: false target: div.tournamentsBoxDescription timeStamp: 102788.7999997139 type: "click" view: Window {window: Window, self: Window, document: document, name: '', location: Location, …} _reactName: "onClick" _targetInst: null [[Prototype]]: Object

¿Puede ayudarme alguien? Realmente lo aprecio.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

SyntheticEvent es un objeto que envuelve el Event nativo en React, le brinda las mismas funcionalidades y más, como asegurarse de que tenga el mismo comportamiento en todos los navegadores.

Puede obtener el Event nativo accediendo al atributo nativeEvent de SyntheticEvent , así:

 e.nativeEvent

Puedes consultar la documentación si quieres saber más al respecto.

about 4 years ago · Juan Pablo Isaza Denunciar

0

Asegúrese de no llamar a una función dos veces al mismo tiempo. Tuve un desafío similar, resultó que estaba llamando a la misma función desde un solo formulario al mismo tiempo.

about 4 years ago · Juan Pablo Isaza Denunciar
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