Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

The renderInput prop stopped working on the MUI X DatePicker

ErrorrenderInput does nothing on DatePicker, or TypeScript says the prop does not exist

Short answer

renderInput was removed from the MUI X date pickers in version 6. Put the text field settings in slotProps.textField instead. Two other v5 patterns break in the same upgrade: the locale prop on LocalizationProvider is now adapterLocale, and date adapters come from @mui/x-date-pickers, not @date-io.

  • Applies to @mui/x-date-pickers 6 and newer, React 19
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check which version of the pickers package is installed. renderInput belonged to version 5; from version 6 it is gone.

    npm ls @mui/x-date-pickers
  2. 2Match what you see, then jump to its fix

    1. 1The text field looks like the default one and ignores your TextField propsrenderInput was removed in v6Fix
    2. 2The picker ignores the language you set, for example locale="fr"The locale prop on LocalizationProvider was renamedFix
    3. 3Import errors from @date-io packages after the upgradeDate adapters are imported from the old @date-io packagesFix

What does the error look like?

  • renderInput does nothing on DatePicker, or TypeScript says the prop does not exist
  • The custom TextField (variant, size, helperText) is ignored
  • Adapters imported from @date-io no longer work after upgrading the pickers

Cause 1 of 3

renderInput was removed in v6

1Check

Search for renderInput in the code. In v6 and later the prop is gone and the picker renders its own text field.

grep -rn "renderInput" src/

2Fix

Move the TextField props into slotProps.textField.

// before (v5)
<DatePicker renderInput={(params) => <TextField {...params} variant="outlined" />} />

// after (v6 and newer)
<DatePicker slotProps={{ textField: { variant: 'outlined' } }} />

3Verify

The picker renders with the variant you set.

grep -rn "renderInput" src/

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 3

The locale prop on LocalizationProvider was renamed

1Check

Look at how LocalizationProvider receives the locale.

grep -rn "LocalizationProvider" src/

2Fix

Rename the prop to adapterLocale.

<LocalizationProvider dateAdapter={AdapterDayjs} adapterLocale="fr">
  {children}
</LocalizationProvider>

3Verify

Open the picker. Month and weekday names are in the chosen language.

# open the picker in the browser

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

Date adapters are imported from the old @date-io packages

1Check

From v6 the adapters cannot be imported from @date-io. Look for those imports.

grep -rn "@date-io" src/ package.json

2Fix

Import the adapter from @mui/x-date-pickers. For Luxon, version 3.0.2 or newer is needed.

// example: the Jalaali adapter
import { AdapterMomentJalaali } from '@mui/x-date-pickers/AdapterMomentJalaali';

3Verify

The app builds and the picker opens.

npm run build

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Read the migration guide before raising a major version of the pickers package.
  • Search the code for renderInput, locale= and @date-io right after a major upgrade.
  • Pin the pickers package to a major version in package.json.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

TypeScript rejects MUI Data Grid columns that set a type

A TypeScript error inside a column's renderCell callback

A columns array declared without a type is inferred with type as a plain string, which the Data Grid's column type union does not accept.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.