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

201
Views
Form.Control as="select" parece haber sido eliminado a favor de Form.Select, sin embargo, Form.Select me da un error

Estoy migrando de React-Bootstrap v1 a v2 y de Bootstrap v4 a v5, pero me enfrento al problema de Form.Select que me da un error que dice "Property 'Select' does not exist on type 'Form'" . Estoy tratando de usar Form.Select porque la documentación de migración dice que:

 FormControl# dropped as prop supporting select tags in favor of FormSelect.

Mi componente original se veía así:

 import Form, { FormProps } from 'react-bootstrap/Form'; return ( <Form.Control as="select" value={selected || ''} onChange={(ev: ChangeEvent<HTMLSelectElement>) => onSelect(ev.target.value)} {...rest} style={{ width: 'fit-content', paddingRight: 20, ...rest.style }} // Styled Components break the Form.Control's base styles > <option hidden key="default-empty-option" /> {options.map(({ value, label }, idx) => ( <> {value === customOptionValue ? ( <> <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}> {label} </option> <OptionSeperator key="separator" /> </> ) : ( <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}> {label} </option> )} </> ))} </Form.Control>

Y mi nuevo se ve así:

 return ( <Form.Select value={selected || ''} onChange={(ev: ChangeEvent<HTMLSelectElement>) => onSelect(ev.target.value)} style={{ width: 'fit-content', paddingRight: 20, ...rest.style }} // Styled Components break the Form.Control's base styles > <option hidden key="default-empty-option" /> {options.map(({ value, label }, idx) => ( <> {value === customOptionValue ? ( <> <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}> {label} </option> <OptionSeperator key="separator" /> </> ) : ( <option data-testid={`dropdown-option-${idx}`} key={idx} value={value}> {label} </option> )} </> ))} </Form.Select> );
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!