Skip to content

Using Material UI Datepicker doesn't work due to LocalizationProvider #193

@LuisAzeved

Description

@LuisAzeved

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions