Vue.js 3 Custom Directives
Plans from $25/month

This lesson is for members. Join us?

Subscribe now to get instant access to this course, plus a full library of Vue.js courses tailored to the plan you choose.

The Directive’s unMounted Hook

In this lesson, we learn about a common gotcha when using custom directives together with intervals and events. The key to avoiding such bugs is using the unmounted hook to clear the interval or detach the event listener.

Links