title: Default value for React state storing integer values
body: <p>I have a <code>selectedId</code> React state that stores integer values. The state is updated with an <code>id</code> integer, when an item is selected from a list. Once <code>selectedId</code> is set, the user can click a <code>delete</code> button to delete the selected element, after which <code>selectedId</code> should be set back to its initial value again.</p>
  <p>What is the recommended default value for <code>selectedId</code>? Should it set to null ( <code>useState(null)</code> and <code>setSelectedId(null)</code> ), or be undefined ( <code>setSelectedId()</code> )</p>
  <pre class="lang-js prettyprint-override"><code>const [selectedId, setSelectedId] = useState();
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>const handleSelect = id =&gt; {
    setIsAlertOpen(true);
    setSelectedId(id);
  };
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>&lt;Button onClick={() =&gt; {
    deleteItem(selectedId)
    setSelectedId();
  }/&gt;
  </code></pre>