title: Why should I use key as string for list item in React?
body: <p>React Doc explains why giving a key to list item is important. It specifies that a key is string attribute.</p>
  <p>So should I convert my id to string for key every time?</p>
  <pre><code>&lt;ul&gt;
    {data.map(item =&gt; (
      &lt;li key={item.id.toString()}&gt;
        {item.text}
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>Could you tell me the reason for this? I thought about problem with number sort as strings but it seemed to be another case.</p>
  <p>React Doc. <a href="https://reactjs.org/docs/lists-and-keys.html#extracting-components-with-keys" rel="nofollow noreferrer">List and Keys</a></p>