score:1

Accepted answer

several changes have been made in the sandbox link

  1. calculate the total when click record as asked in the question
  2. add some checking when user press the record button. three inputs need to be filled in.
  3. the input type should be number but not text since it may need to nan if user enter string in the input.
  4. implementing a button to reset all the record.
  5. use map for rendering currentrecord

score:1

it looks like your map should look like this:

    {currentrecord.map(item => (
        <tr>
        <td>1.</td>
        <td>{item.currentbook}</td>
        <td>{item.units}</td>
        <td>{item.price}</td>
        </tr>
      ))
     }

Related Query

More Query from same tag