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

156
Visualizações
Can't access MenuItem property in Select React

I'm trying to select through menu in react and get the item's Id.

The Structure is

FormControl
   Select
       MenuItem
       MenuItem
       MenuItem

I set the MenuItem 'key' property to some value and I want to reach it in the Select 'onChange' function but I can only seem to get the value of the MenuItem.

Since the code is private I can't share it, but I'm trying to get the logic behind a process like I described above.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The key prop is just used by React, and isn't meant to be used by you. It looks like you're using MaterialUI. If there's some data you need passed to <MenuItem />'s, one possibility is to create you're own MenuItem component that extends MaterialUI's, so that you can pass whatever data it is that you need as a prop, and also pass a function to it as another prop so that you can have more control over what is shared between the component and it's parent. Hopefully that's helpful without having more info about the code.

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