Stack Exchange
material-ui-pickers example: TypeError: Object(...) is not a function
I am trying to set up the most basic possible material UI pickers example using a bare project and following the installation and usage steps described here: https://material-ui-pickers.dev/
I get the following error: 
TypeError: Object(...) is not a function
Module../node_modules/@material-ui/pickers/dist/material-ui-pickers.esm.js
node_modules/@material-ui/pickers/dist/material-ui-pickers.esm.js:25
  22 | import Tab from '@material-ui/core/Tab';
  23 | import Tabs from '@material-ui/core/Tabs';
  24 | import Paper from '@material-ui/core/Paper';
> 25 | var useStyles = makeStyles(function (theme) {
  26 |   var textColor = theme.palette.type === 'light' ? theme.palette.primary.contrastText : theme.palette.getContrastText(theme.palette.background.default);
  27 |   return {
  28 |     toolbarTxt: {

The steps I followed are:
create-react-app material-ui-pickers-demo

yarn add @material-ui/core

yarn add @material-ui/pickers

yarn add @date-io/date-fns

import React, { useState } from "react";
import DateFnsUtils from "@date-io/date-fns"; // choose your lib
import {
  DatePicker,
  TimePicker,
  DateTimePicker,
  MuiPickersUtilsProvider,
} from "@material-ui/pickers";

function App() {
  const [selectedDate, handleDateChange] = useState(new Date());

  return (
    <MuiPickersUtilsProvider utils={DateFnsUtils}>
      <DatePicker value={selectedDate} onChange={handleDateChange} />
      <TimePicker value={selectedDate} onChange={handleDateChange} />
      <DateTimePicker value={selectedDate} onChange={handleDateChange} />
    </MuiPickersUtilsProvider>
  );
}

export default App;

yarn start

yarn version is 1.16.0
node version is v12.1.0
edit: I have seen this question and it did not answer mine Uncaught TypeError: Object(...) is not a function when importing @material-ui/pickers

Sorry, what is the React version?

The cause is a wrong version of @material-ui/core. @material-ui/pickers works fine only with @material-ui/core@v4.0.0-beta.1 for now. @material-ui/core beta 1 and @material-ui/pickers is too raw for using them in projects.
So, to fix your problem you need following steps:
Remove node_modules directory and 
run yarn add @material-ui/core@v4.0.0-beta.1
and finally run @material-ui/pickers@3.0.0-beta.1
It should fix the error.

This was the issue, thanks. In future I'll know to look at dependencies in the codesandbox.io examples they produce too, very useful to know!
