Member-only story
Lifecycle of the Svelte Component
Understanding lifecycle of component is important to implement.
2 min readApr 17, 2020

This post is one of Svelte Tutorial series.
- Up and running with Svelte
- How to handle Events in Svelte
- How binding data into Svelte Component
- [This Post] Lifecycle of the Svelte Component
LifeCycle Functions
The svelte has some lifecycle functions.

onMount
: runs after the component is first rendered to the DOM.onDestroy
: runs when the component is destroyed.beforeUpdate
: runs before the DOM has been updated.afterUpdate
: runs after the DOM has been updated(It's counterpart of thebeforeUpdate
).tick
: unlike other functions(I'll describe at the last part of this post).