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

182
Vistas
React onMouseOver not working with any functions

(I am new to React) This might be something simple but I have looked through a number of other issues like this and cant figure out what I am doing wrong. I am trying to just do a simple function on onMouseOver but for some reason it is never called.

Here is what I have thus far:

export default class CardLineItemProgressBarPart extends React.Component<Props> {
  constructor(props:Props) {
    super(props)
    this.showPopup = this.showPopup.bind(this)
  }

  componentDidMount() {
  
  }

  xOffset = 0;
  yOffset = 0;
  visible = false;

  render() {
    return (
      <div className="CardLineItemProgressBarPart"
      style={{
        backgroundColor: this.props.color,
        width: (this.props.percent + '%')
      }}
      onMouseOver={() => console.log("mouse enter")}>
    </div>
    )
  }
}

But I never see anything logged in the console. Am I missing something simple? This worked for me for onClick on another Component so I tried to mimic that here which I think I did but neither work on this component.

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

0

 <div 
      style={{
        backgroundColor: 'black',
        width: '400px',
        height: '400px'
      }}
      onMouseOver={() => console.log("mouse enter")}>
    </div>`

This works, so something else must be wrong.

See sandbox:

https://codesandbox.io/s/hardcore-mendel-wpfn55?file=/src/App.js

about 4 years ago · Juan Pablo Isaza Denunciar

0

I was missing that I had adjusted z-index for some CSS layout and it put the element behind another.

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