title: Is it possible to make a child component inside a slot to send data to his parent?
body: <p>I'm trying to create a Form component in Sveltejs.
  This Form component will use <code>&lt;slot /&gt;</code> to let his parent (App.svelte) define which Inputs and Buttons should be inside the Form.
  The Inputs and Buttons are components too and once the Input component's value changes I'd like to update an object inside the parent Form component and when Button is clicked I'd like to send data back to the App component.</p>
  <p>I've tried to read Svelte documentation and solve this problem playing around with <code>&lt;slot let:name={value}&gt;</code> but I can't find a way to update Form component when an Input component's value changes.</p>
  <p>This is the structure of what I'm trying to do:</p>
  <p>App.svelte</p>
  <pre class="lang-html prettyprint-override"><code>...
  &lt;Form on:submit={saveReceivedData}&gt;
    &lt;Input name=&quot;...&quot; value=&quot;...&quot; /&gt;
    &lt;Button /&gt;
  &lt;/Form&gt;
  ...
  </code></pre>
  <p>Form.svelte</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script&gt;
  ...
  let data = {}
  &lt;/script&gt;
  ...
  &lt;form&gt;
    &lt;slot /&gt;
  &lt;/form&gt;
  ...
  </code></pre>
  <p>Input.svelte</p>
  <pre class="lang-html prettyprint-override"><code>...
  &lt;input name={name} value={value} on:input={updateDataVariableOnFormComponent} /&gt;
  ...
  </code></pre>
  <p>Button.svelte</p>
  <pre class="lang-html prettyprint-override"><code>...
  &lt;button on:click={sendDataVariableToAppComponent}&gt;Send&lt;/button&gt;
  ...
  </code></pre>
  <p>I can try to send you a full code if needed. But, since my problem is not &quot;what I'n doing wrong?&quot; but &quot;how can I do this?&quot;, I prefer to write my question in an abstract way.</p>