React-Google-Apps-Script icon indicating copy to clipboard operation
React-Google-Apps-Script copied to clipboard

Using Material UI Datepicker doesn't work due to LocalizationProvider

Open LuisAzeved opened this issue 1 year ago • 0 comments

I'm using Material UI for some client components like buttons, etc.

Now, I wanted to use the Material UI date picker but I'm unable to. Basically to use Material UI date picker I need to wrap my react component with a LocalizationProvider:

import React from 'react';
import { LocalizationProvider, DatePicker } from '@mui/x-date-pickers';
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';

const Sidebar = () => {
   return (<LocalizationProvider dateAdapter={AdapterMoment}>
             <DatePicker
                label="Date Start"
                value={selectedDateStart}
                onChange={(newValue) => setSelectedDateStart(newValue)}
              />
  </LocalizationProvider>)

}

export default Sidebar;

However, when I use the LocalizationProvider, the sidebar keeps blank.

Screenshot: image.jpg

No error is thrown on the console. Everything just stays blank.

LuisAzeved avatar May 25 '23 14:05 LuisAzeved