0Pricing
Sveltejs Academy · Lesson

tick(): Waiting for DOM Updates

Await tick() to ensure the DOM reflects the latest state before reading layout values.

What tick Is

tick() returns a promise that resolves after pending state changes have been applied to the DOM.

Import It

Import from svelte.

<script>
  import { tick } from "svelte";
</script>

All lessons in this course

  1. onMount: Running After Render
  2. onDestroy: Cleanup
  3. beforeUpdate and afterUpdate
  4. tick(): Waiting for DOM Updates
← Back to Sveltejs Academy