onBeforeUnmount not triggering callback
Vue version
3.2.39
Link to minimal reproduction
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())