Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda