Skip to content

onBeforeUnmount not triggering callback #6686

Closed
@oswaldofreitas

Description

@oswaldofreitas

Vue version

3.2.39

Link to minimal reproduction

https://sfc.vuejs.org/#eNqNUstu2zAQ/JUtL5KBSESbUw1ZcB8o0Hvaky62tLJZiw/w4TQw9O9dio7qKkGRmzS7nJndnQv7ZEx5DsjWrPIozbDzWDcKoNoH77WCbTuI9rRpmNeHw4ANqx+mj4qnhtT8RUsD50L01CjcT+HEPvZyqlb8hpd+XWuF8eDQB0OIkEZbDxew2MMIvdUSMjKUzaWJO+Eljz/RL5UBGtVq5TzMirCJNLm3AVdRrA+q9YKmSObzFVziu7m/PO+GEF+9W0CNGqPz5LVmdyx5KeTOlL+cVrSuiYmmnQquYevEHTHyF/8bdvTeuDXnQZnToWy15FuqcRuUFxKLTsvtffmhvP/IO+H8LV6ik8Xe6keHlhQbdndDzgk8oy0sqg4t2v+KLXr/EVzUXohGTVrESAt4XvzLoJj6O53zqMPQwaAPIGjdR4R4Gk0nQVJ4gjgXwcIRThtTqOLZICipaWjsKh7D8NasaPUZe23xR3r+em4uIJ++UQDmaknsztNg1NMozuGrRqcyD4/antbQ7obBTdbn2Gg1kHVC3lPK4giNWkjnSYPSFuNInA9xxkjoXmX8u43YvSSjgG7qq+18RaS3EbyapwPg72nAmfT5QUrgdfEl3SLPUikjqpGNfwDSdWIu

Steps to reproduce

Import a function from another file in a component and pass it to onBeforeUnmount hook directly (without creating an anonymous function)

What is expected?

Every time the component is unmounted it should call the imported function

What is actually happening?

It's only calling the imported function the first time the component is unmounted

System Info

No response

Any additional comments?

in the reproducible example there is a commented line showing what I need to do for it to work (create an anonymous function)

onBeforeUnmount(myFunc)
onBeforeUnmount(() => myFunc())

Activity

added a commit that references this issue on Sep 17, 2022
2fad93c
added a commit that references this issue on Sep 27, 2022
c71a08e
added a commit that references this issue on Feb 4, 2023
42bf713
locked and limited conversation to collaborators on Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @LinusBorg@oswaldofreitas

      Issue actions

        onBeforeUnmount not triggering callback · Issue #6686 · vuejs/core