Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

100
Visualizações
Reactjs warns of list needing unique key props but can't find duplicate or absentee?

As the title says, I have provided a key to every component and I believe they are unique. To reproduce this as simply as possible, I'm providing a snapshot of the rendered components with IDs that show no duplicates or absentees. This is taken from the react dev console and shows that keys are being picked up correctly for each component.

snapshot of components

The second Step is throwing the following error:

Warning: Each child in a list should have a unique "key" prop.

I'm not having an functional issues but I do want to make sure I'm not doing anything wrong.

The only luck I've had so far is when removing the Marker component. The error disappears. However, all the sub levels have keys too, including Marker, so I can't make sense of this outcome.

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

The answer was something I'd overlooked:

<Step>
    <StepPropGroup />
    <StepPropGroup />
    <React.Fragment>
        <Marker />
        <StepPropComment />
    </React.Fragment>
</Step>

React.Fragments can also have keys. I was so unaware of this that I didn't even think of mentioning it as it was superfluous. However, adding a key to it now resolves the error.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda