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

216
Visualizações
React-Typescript - Mapping props with dictionary type

I have been using Typescript with React from a while. I have a scenario where my type definition is similar to this

type Attributes: {
 industries: [];
 regions: [];
 products: [];
 [key: string]: [];
}

The top three props are consistent while the last one can be areaTypes or categories.

Now when I map through these props I can read the data of the top three props as their names are consistent but when I want the value for the dictionary prop I have to give the name of that specific prop in order to read it.

<ul>
  {props.areaTypes.map((item) => (
    <li>{item}</li>
  ))}
</ul>

I want to know if there is any other efficient way to read values of dictionary type, so I don't have to type in the name of the unknown props each time to map it.

about 4 years ago · Juan Pablo Isaza
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