-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Description
Reproduction link: https://codesandbox.io/s/watcher-clean-up-issue-elnq1
Open the console and toggle the Child
component a few times. the onCleanup
function registered on the watch
is never executed when the component is unmounted, which is one of the expected behaviors as described in the API reference:
The cleanup callback is called when:
the watcher is about to re-run
the watcher is stopped (i.e. when the component is unmounted ifwatch
is used insidesetup()
)
I also tried to manually stop the watch and the onCleanup
callback doesn't run then either. It does run however before the watcher is about to re-run, as you can see by typing something on the provided input
.
It could be however that I'm misinterpreting the expected behavior.
Thank you!
Metadata
Metadata
Assignees
Labels
No labels