score:5

Accepted answer

The import is wrong. It should be:

import MomentUtils from '@date-io/moment';

You can refer to working CodeSandbox demo:https://codesandbox.io/s/material-demo-h3ke7?fontsize=14

Clarification:

  • date-io provides abstraction over common javascript date management libraries. date-io/moment is just one of them. data-io GitHub
  • You must install both moment and data-io/moment
  • Material-ui/pickers fully relies on data-io. You must install it if you want to use material-ui pickers. You can further read in material-ui-pickers GitHub

score:2

I faced the same issue in date picker documentation https://material-ui-pickers.dev/getting-started/installation

install thie version npm i @date-io/moment@1.x moment


Related Query

More Query from same tag