onCleanup in Root component?

o/ so i have this component in my root. if i refresh the page, it doesn't log the cleaning up root!! message. is there any other way to run code when the app stops/refreshes?
onCleanup(() => {
   console.log("cleaning up root!!")
})
Was this page helpful?