score:1

Accepted answer
import React, { Component } from "react";

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
      allValues: {
        bloodsugar: "",
        bloodpressure: "",
      },
    };
  }

  changeHandler = (e) => {
    this.setState({
      allValues: { ...this.state.allValues, [e.target.name]: e.target.value },
    });
  };

  onsubmbit = (e) => {
    e.preventDefault();
    console.log(this.state.allValues);
  };
  render() {
    return (
      <form onSubmit={this.onsubmbit}>
        <div>
          <div style={{ fontSize: "4rem", padding: "15px" }}>
            <i className="fa fa-level-up"></i>
          </div>
          <div style={{ padding: "10px" }}>
            <strong>Enter your blood sugar level</strong>
            <br />
            <input
              type="text"
              name="bloodsugar"
              onChange={this.changeHandler}
              value={this.state.allValues.bloodsugar}
            />
          </div>
        </div>
        <div>
          <div style={{ fontSize: "4rem", padding: "15px" }}>
            <i className="fa fa-area-chart"></i>
          </div>
          <div style={{ padding: "10px" }}>
            <strong>Enter your blood pressure level</strong>
            <br />
            <input
              type="text"
              name="bloodpressure"
              onChange={this.changeHandler}
              value={this.state.allValues.bloodpressure}
            />
          </div>
        </div>

        <button type="submit">Submit</button>
      </form>
    );
  }
}

Related Query

More Query from same tag