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

216
Views
ReactJS - onhashchange vs addEventListener("hashchange")

Estoy usando un oyente de cambio de hash en mi componente React. El oyente se monta en componentDidMount() a través de onhashchange en lugar de usar addEventListener() a través de la línea comentada. ¿Hay diferencia entre los dos?

 componentDidMount:function(){ onhashchange=this.checkHash //window.addEventListener("hashchange", this.checkHash); },

Está llamando a una función personalizada checkHash().

¿Cómo desmonto el oyente?

¿Es lo mismo que:

 componentWillUnmount:function(){ window.removeEventListener("hashchange", this.checkHash); }

Gracias.

over 4 years ago · Santiago Trujillo
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!