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

102
Views
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
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!