As for state record users in an array from a form?

Tell me how to create an array with the users (list) is introduced through the form of state to send it to the server?
class SignIn extends Component {
 state = {
 name: "",
 organization: "",
 email: "",
current:"",
 phone: "",
 simulator: "",
 error: "",
 list: []
};
 componentDidMount() {
auth.logout();
}

 handleChange = e => {
 const { name, value } = e.target;
 this.setState({ [name]: value });


};
 onSubmit = e => {
e.preventDefault();
 const { ID } = this.state;
localStorage.clear();
 localStorage.setItem("userName", name);
 const local = localStorage.getItem("userName");
};

 render() {
 const { classes } = this.props;
 return (
 <main className={classes.main}>
 <CssBaseline />
 <Paper className={classes.paper}>
 <form className={classes.form} onSubmit={this.onSubmit}>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="name">the Name</InputLabel>
<Input
id="name"
name="name"
autoComplete="name"
autoFocus
onChange={this.handleChange}
/>
</FormControl>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="organization">company Name</InputLabel>
<Input
id="organization"
name="organization"
autoComplete="organization"
onChange={this.handleChange}
/>
</FormControl>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="email">E-MAIL</InputLabel>
<Input
id="email"
name="email"
autoComplete="email"
onChange={this.handleChange}
/>
</FormControl>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="current">Post</InputLabel>
<Input
id="current"
name="current"
autoComplete="current"
onChange={this.handleChange}
/>
</FormControl>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="phone">Phone</InputLabel>
<Input
id="phone"
name="phone"
autoComplete="phone"
onChange={this.handleChange}
/>
</FormControl>
 <FormControl margin="normal" required fullWidth>
 <InputLabel htmlFor="simulator">simulator What is the need?</InputLabel>
<Input
id="simulator"
name="simulator"
autoComplete="simulator"
onChange={this.handleChange}
/>
</FormControl>
<Button
type="submit"
fullWidth
variant="contained"
color="primary"
className={classes.submit}
>
 To record user
</Button>
</form>
</Paper>
</main>
);
}
}
export default withStyles(styles)(SignIn);
March 23rd 20 at 20:20
0 answer

Find more questions by tags ReactJavaScript