Problem Statement
How do you access lifecycle hooks with the Composition API?
Explanation
Use onMounted, onUpdated, onUnmounted, and other on* functions inside setup(). They register lifecycle callbacks for the current component instance without using the Options API.
Code Solution
SolutionRead Only
import { onMounted, onUnmounted } from 'vue'
onMounted(() => start())
onUnmounted(() => stop())