title: How to focus on input field loaded from component in Svelte?
body: <p>After loading the component that has input filed inside it. How can I focus on that particular field?</p>
  
  <p><strong>TextField.svelte</strong></p>
  
  <pre><code>&lt;script&gt;
  
    export let label = ''
    export let name = ''
    export let placeholder = ''
    export let value = ''
  
  &lt;/script&gt;
  
  &lt;div class="field"&gt;
    &lt;label for={name}&gt;{label}&lt;/label&gt;
    &lt;input {placeholder} type="text" {name} bind:value={value} &gt;
    &lt;slot&gt;&lt;/slot&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>App.svelte</strong></p>
  
  <pre><code>&lt;script&gt;
    import TextField from './TextField'
    import {onMount} from 'svete'
  
    onMount(() =&gt; {
      // This line is funny.. I know
      document.querySelector('[name="firstname"]').focus()
    })
  
  &lt;/script&gt;
  
  &lt;TextField label="First Name" name="firstname" /&gt;
  </code></pre>