Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onBeforeUnmount not triggering callback #6686

Closed
oswaldofreitas opened this issue Sep 16, 2022 · 0 comments · Fixed by #6687
Closed

onBeforeUnmount not triggering callback #6686

oswaldofreitas opened this issue Sep 16, 2022 · 0 comments · Fixed by #6687
Labels
🐞 bug Something isn't working

Comments

@oswaldofreitas
Copy link

oswaldofreitas commented Sep 16, 2022

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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
2 participants