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. Termos, variáveis, expressões ou referências devem ser SEMPRE mantidos em inglês. 3. Apenas transcreva o artigo, tornando ele mais literal e direto, para um português simples, sem alterar o contexto. 4. Não remova as tags HTML e nem os "#thedivisor#". 5. Você deve me enviar sua resposta em texto puro, sem markdown.
In this lesson, we will cover keys in React. Keys are special props for our components and we’ll learn why they are used.#thedivisor#This section contains a general overview of topics that you will learn in this lesson.#thedivisor#<li>Learn what keys are in React and why it needs them.</li> <li>Identify examples of good and bad key usage in React applications.</li>#thedivisor#In the upcoming lessons as you learn more about the internal workings of React, more specifically the rerendering process, you will understand the importance of keys. For now, we will keep it short.#thedivisor#In the previous lesson on rendering lists, we used the <code>.map()</code> method to iterate over an array of data and return a list of elements. Now imagine, if any of the items in the list were to change, how would React know which item to update?#thedivisor#If the list were to change, one of two things <em>should</em> happen:#thedivisor#<li>we completely re-render the entire list, or:</li> <li>we hunt down the specific items that were changed and only re-render those.</li>#thedivisor#Assuming we want to hunt down that one specific item that was changed and NOT re-render the entire list. We need something to track that specific item. We can track down a specific item by using a <code>key</code>.#thedivisor#When the list is updated for whatever reason, (either from a server or a user interaction), React matches the <code>keys</code> of each of the previous list items to the updated list. If there were any changes, React will only update the items that have changed.#thedivisor#As long as <code>keys</code> remain consistent and unique, React can handle the DOM effectively and efficiently. - Assistant
Nesta lição, vamos abordar os keys em React. Keys são props especiais para nossos componentes e aprenderemos por que são utilizados. #thedivisor# Esta seção contém uma visão geral dos tópicos que você irá aprender nesta lição. #thedivisor# Aprender o que são keys em React e por que precisamos deles. Identificar exemplos de bom e mau uso de keys em aplicações React. #thedivisor# Nas próximas lições, à medida que você aprender mais sobre o funcionamento interno do React, mais especificamente sobre o processo de re-renderização, você compreenderá a importância dos keys. Por enquanto, vamos manter curto. #thedivisor# Na lição anterior sobre renderização de listas, usamos o .map() para iterar sobre um array de dados e retornar uma lista de elementos. Agora imagine, se algum dos itens na lista mudar, como o React saberia qual item atualizar? #thedivisor# Se a lista mudasse, uma de duas coisas deveria acontecer: #thedivisor# nós re-renderizamos completamente toda a lista, ou: nós procuramos os itens específicos que foram alterados e apenas re-renderizamos esses. #thedivisor# Supondo que queremos procurar aquele item específico que foi alterado e NÃO re-renderizar toda a lista. Precisamos de algo para rastrear aquele item específico. Podemos rastrear um item específico usando um key. #thedivisor# Quando a lista é atualizada por qualquer motivo (seja de um servidor ou uma interação do usuário), o React compara os keys de cada um dos itens anteriores da lista com a lista atualizada. Se houver alguma mudança, o React atualizará apenas os itens que foram alterados. #thedivisor# Enquanto os keys permanecerem consistentes e únicos, o React pode manipular o DOM de forma eficaz e eficiente.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.