If your application needs to collect the date and time from the user, you don't necessarily need two TextField components. Instead, you can combine them both into a single field.
Combining date and time components
How to do it...
You can use a single TextInput component to collect date and time input from the user by setting the type property to datetime-local:
import React, { Fragment, useState } from 'react';
import { makeStyles } from '@material-ui/styles';
import TextField from '@material-ui/core/TextField';
const useStyles = makeStyles(theme => ({
textField: { margin: theme.spacing(1) }
}));
const formatDate = date =>
date
.toISOString()
.split(':')
.slice(0, 2...