assembler
assembler

Reputation: 3300

ReactJS Material UI how to use DatePicker, LocalizationProvider, AdapterDateFns

I am trying to use the Material UI date picker on my project. According to this the last version of @material-ui/lab is 4.0.0-alpha.57, which is the one I have installed:

enter image description here

however

import AdapterDateFns from '@material-ui/lab/AdapterDateFns';
import LocalizationProvider from '@material-ui/lab/LocalizationProvider';
import DatePicker from '@material-ui/lab/DatePicker';

complain

Module not found: Error: Can't resolve '@material-ui/lab/AdapterDateFns' 
Module not found: Error: Can't resolve '@material-ui/lab/DatePicker'
Module not found: Error: Can't resolve '@material-ui/lab/LocalizationProvider' 

How can I proceed?

Upvotes: 1

Views: 10776

Answers (1)

Medi Messarat
Medi Messarat

Reputation: 36

i had the same issue,

you have to upgrade both of your @material-ui/lab and @material-ui/core to 5.0.0-alpha.24 and above. This is already answered here https://stackoverflow.com/a/66125652

For me i tried this solution and upgraded to alpha versions but a lot of things that i've already built with @material-ui/core 4.11.3 got screwed. So i went back to 4.11.3.

Upvotes: 2

Related Questions