How it works…

If you run the application, you will see this:

As you can see, we are using an input with type number, which means we will only accept numbers if you start writing numbers (1, then 2, then 3, and such), you will see the results of the sum on each row (0 + 1 = 1, 1 + 2 = 3, 3 + 3 = 6).

Probably this looks very simple to you, but if let's inspect the application using React Developer Tools, we need to enable the Highlight Updates option.

After this, start writing multiple numbers in the input (quickly), and you will see all the ...

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.