import React, { Component } from "react"; import "./Form.css"; import { api } from "./api"; class Form extends Component { state = { name: "", email: "", number: "", optIn: true, }; handleChange = (str) => { return e => this.setState({ [str]: e.currentTarget.value }); }; handleSubmit = (e) => { e.preventDefault(); api.addUser(this.state.name, this.state.email, this.state.number); }; handlePromotionClick = () => { this.setState({ optIn: !this.state.optIn }); }; render() { return ( // The data-testid attributes give us more security for tests, than those use for styling.

Request information

); } } export { Form };