title: Type 'number' is not assignable to type 'SetStateAction<undefined>'. - React
body: <p>I have a SelectInput that let me choose 1, 2 or 3, and below that I have a MultiSelect (with Mantine library).</p>
  <p>I would like to select the number of co-pilot (on the SelectInput), and allow the selected number on the MultiSelect.</p>
  <p>Here is my code :</p>
  <pre><code>const [maxCopilote, setMaxCopilote] = useState()
  
  &lt;NumberInput
        defaultValue={1}
        max={3}
        min={1}
        required
        placeholder=&quot;Number of copilot&quot;
        onChange={(e) =&gt; setMaxCopilote(e)}
   /&gt;
                                          
  &lt;MultiSelect
        data={['Copilote1', 'Copilote2', 'Copilote3']}
        required
        placeholder=&quot;Select copilote(s)&quot;
        maxSelectedValues={maxCopilote}
        clearable
  /&gt;
  </code></pre>
  <p>With this code, I got the error :</p>
  <pre><code>Argument of type 'number | undefined' is not assignable to parameter of type SetStateAction&lt;undefined&gt;.
  Type 'number' is not assignable to type 'SetStateAction&lt;undefined&gt;'.  TS2345
  </code></pre>
  <p>How can I get the number I selected, to put it dynamicaly into <code>maxSelectValues</code> ?</p>
  <p>Thank you</p>
  <p>PS : <code>console.log(e)</code> onChange in the numberInput, log the selected number correctly</p>