Vedant Shah
Vedant Shah

Reputation: 1386

Unable to use helperText in mui date picker

Here is the code:

<div className={classes.container}>
                <LocalizationProvider dateAdapter={AdapterDateFns}>
                    <DesktopDatePicker
                        fullWidth
                        inputFormat="dd/MM/yyyy"
                        // value={registeredDate}
                        disableFuture
                        {...props}
                        helperText="date"
                        renderInput={(params) => <TextField {...params} />}
                    />
                </LocalizationProvider>
            </div>

I am not seeing the helper text working. Please help

Upvotes: 1

Views: 1168

Answers (1)

CD..
CD..

Reputation: 74096

The helperText is the TextField's prop, you can set it like this:

<DesktopDatePicker
  fullWidth
  inputFormat="dd/MM/yyyy"
  disableFuture
  {...props}
  renderInput={(params) => <TextField helperText="date" {...params} />}
 />

Upvotes: 3

Related Questions