Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda