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

182
Views
componentWillUnmount doesn't run because webpack is too fast or overrides

My electron forge webpack template based application is supposed to save content whenever it is closed down. The onUnload successfully runs whenever I with a toolbar button switch to a plain html page which, with the fact that the same code worked before I implemented webpack out of necessity, proves it is due to webpack that componentWillUnMount is never sucessfully called.

onUnload(){
        axios.post("http://localhost:2999/calendar/unload", {days:this.useCalendarData, subjects:this.userSubjects, lastWeekErase:this.lastWeekErase})
        .catch(err=>{console.log(err)})
    }
      
    componentDidMount() {
        window.addEventListener("beforeunload", this.onUnload)
    }
    
    componentWillUnmount() {
        window.removeEventListener("beforeunload", this.onUnload)
    }

Is it like possible to delay webpack's hasty termination so that React has time to run?

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