With Svelte we can do some cleanup when a component is destroyed by either returning a function in onMount or using onDestroy. These are both ignored when navigating back via actionBar or using navigate.
Page components are usually cached for backwards navigation, and that might be why you face this problem.
Upon navigating back using back button or goBack method, component will trigger onDestroy callback.
With Svelte we can do some cleanup when a component is destroyed by either returning a function in
onMount
or usingonDestroy
. These are both ignored when navigating back via actionBar or usingnavigate
.Reproduction: https://github.com/daveychu/svelte-native-on-destroy-bug