--- title: onMount --- Every component has a _lifecycle_ that starts when it is created, and ends when it is destroyed. There are a handful of functions that allow you to run code at key moments during that lifecycle. The one you'll use most frequently is `onMount`, which runs after the component is first rendered to the DOM. We briefly encountered it [earlier](/tutorial/bind-this) when we needed to interact with a `` element after it had been rendered. We'll add an `onMount` handler that loads some data over the network: ```svelte ``` > It's recommended to put the `fetch` in `onMount` rather than at the top level of the `