Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
¿Existe una forma más sencilla de devolver dinámicamente un valor de estado de reacción a través de una clave transmitida?

Buenos días, solo tengo una pregunta sobre la generación de formularios dinámicos. Estoy recorriendo una serie de objetos y para cada género estoy generando un campo desplegable, también estoy filtrando una lista de elementos para encontrar qué pertenece en qué lista desplegable. Entonces, mi pregunta es, ¿hay alguna manera de asignar dinámicamente a la lista desplegable un valor que se almacena arriba como tal?

 const [company, setCompany] = React.useState([]); const [division, setDivision] = React.useState([]); const [jobDescription, setJobDescription] = React.useState([]); const [businessUnit, setBusinessUnit] = React.useState([]); const [region, setRegion] = React.useState([]); const [costCenter, setCostCenter] = React.useState([]); const [personType, setPersonType] = React.useState([]); function getMenuItemsForType(type){ let filtered = limiters.filter(x => x.limiter_TypeOption === type.limiterTypeId); return Object.keys(filtered).map((x) => { return (<MenuItem value={filtered[x].limiterOptionId}>{filtered[x].limiterOptionName} </MenuItem>) }) } {Object.keys(types).map((x) => { return ( <div className="m-3"> <FormControl variant="standard" sx={{ m: 1, minWidth: 1200 }}> <InputLabel id="demo-simple-select-standard-label">{types[x].limiterTypeName}</InputLabel> <Select labelId="demo-simple-select-standard-label" id="demo-simple-select-standard" value={x == 0 ? company : x == 1 ? division : x == 2 ? jobDescription : x == 3 ? businessUnit :x == 4 ? region : x == 5 ? costCenter : personType } label={types[x].limiterTypeName} onChange={(itm) => setTypeValue(itm.target.value[0], x)} style={{width: '800px'}} multiple > {getMenuItemsForType(types[x])} </Select> </FormControl> </div> ); })}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!