I've got the following npm packages installed:
"@mui/icons-material": "^5.15.19",
"@mui/lab": "^5.0.0-alpha.170",
"@mui/material": "^5.15.19",
"@mui/system": "^5.15.15",
"@mui/x-date-pickers": "^7.6.2",
I'm running these imports:
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
import {AdapterDateFnsV3} from "@mui/x-date-pickers/AdapterDateFnsV3";
DatePicker and TimePicker import correctly as usual, but AdapterDateFnsV3 imports as "undefined". I've checked and there is a folder at node_modules/@mui/x-date-pickers/AdapterDateFnsV3
.
What am I missing?
Instead of:
import { AdapterDateFnsV3 } from "@mui/x-date-pickers/AdapterDateFnsV3";
You need to import the adapter like this:
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFnsV3';
as it is stated here.
You can take a look at this StackBlitz for a live working example.