Rescreva essa parte da string com as seguintes condições: 1. Não elimine NENHUMA…
- User
Rescreva essa parte da string com as seguintes condições: 1. Não elimine NENHUMA informação dada no artigo. 2. Conceitos, termos ou referências devem ser mantidas em inglês. 3. Apenas transcreva o artigo para português brasileiro, dentro de seu contexto. 4. Não remova as tags HTML e nem os "#thedivisor#". 5. Você deve me enviar sua resposta em texto puro, sem markdown.
#thedivisor#Notice that all the sandboxes above show an error in the console:#thedivisor#You need to give each array item a <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">key</code> — a string or a number that uniquely identifies it among other items in that array:#thedivisor#JSX elements directly inside a <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">map()</code> call always need keys!#thedivisor#Keys tell React which array item each component corresponds to, so that it can match them up later. This becomes important if your array items can move (e.g. due to sorting), get inserted, or get deleted. A well-chosen <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">key</code> helps React infer what exactly has happened, and make the correct updates to the DOM tree.#thedivisor#Rather than generating keys on the fly, you should include them in your data:#thedivisor#What do you do when each item needs to render not one, but several DOM nodes?#thedivisor#The short <a class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="/reference/react/Fragment"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><>...</></code> Fragment</a> syntax won’t let you pass a key, so you need to either group them into a single <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><div></code>, or use the slightly longer and <a class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="/reference/react/Fragment#rendering-a-list-of-fragments">more explicit <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><Fragment></code> syntax:</a>#thedivisor#Fragments disappear from the DOM, so this will produce a flat list of <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><h1></code>, <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><p></code>, <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><h1></code>, <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><p></code>, and so on.#thedivisor#Different sources of data provide different sources of keys:#thedivisor#<li class="leading-relaxed mb-1"><strong class="font-bold">Data from a database:</strong> If your data is coming from a database, you can use the database keys/IDs, which are unique by nature.</li> - Assistant