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

204
Vistas
Form.Control as="select" seems to be removed in favor of Form.Select, however, Form.Select gives me an error

I am migrating from React-Bootstrap v1 to v2 and from Bootstrap v4 to v5 but I'm facing the issue of Form.Select giving me an error saying "Property 'Select' does not exist on type 'Form'". I'm trying to use Form.Select because the migration documentation says that:

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

My original component looked like this:

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>

And my new one looks like this:

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
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