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

98
Vistas
Error in using Style Tag of MUI with styled-component and Typescript

I created SelectType component using Styled Component as follows:

import Select from '@mui/material/Select';

export const SelectType = styled(Select)`
    width:100%;
    border:2px solid #eaeaef;
    border-radius:8px;
    margin-top:2px;
    /* padding:8px; */
`

Then I am using it as follows:

 <SelectType
     value={dataFieldType}
     placeholder="Select Data Field Type"
     onChange={handleSelect}
 >
    <MenuItem value={"address"}>Address</MenuItem>
    <MenuItem value={"number"}>Number</MenuItem>
 </SelectType>

handleSelect function is as follows:

 const handleSelect = (e:SelectChangeEvent) => {
       setDataFieldType(e.target.value as string)
 }

But onChange is showing this error:

No overload matches this call. Overload 1 of 2, '(props: { input?: ReactElement<any, any> | undefined; label?: ReactNode; slot?: string | undefined; style?: CSSProperties | undefined; title?: string | undefined; ... 292 more ...; variant?: "filled" | ... 2 more ... | undefined; } & { ...; } & { ...; }): ReactElement<...>', gave the following error.

If I am directly using Select from MUI, it is working fine but throwing error for SelectType

How can I resolve this?

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