'How to empty a text box by using a button in react?

I have a text box to input numbers, and after pressing the button, I want to clear the text box value. I have no idea how to do it, and can anybody help me?

Table

Example: When I press the add button in the Chairs row, 10 should be cleared.

<CRow>
  <CCol className="col-sm-6">
    <CFormInput
      id="quantity"
      type="number"
      name="quantity"
      max={item.available}
      min={1}
      onChange={(e) => {
        resetErrors()
        quantity[index] = e.target.value
      }}
    />
  </CCol>
  <CCol>
    <CButton
      color="success"
      size="sm"
      onClick={() => {
        resetErrors()
        handleSave(item._id, index)
      }}
    >
      <CIcon icon={cilPlus} className="me-2" />
      Add
    </CButton>
  </CCol>
</CRow>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source