My input method and handleSign method setState at different times, why is this?[React.JS]

My input method and handleSign method setState at different times, why is this?[React.JS]
0

#1

The following codepen has the methods on line 20 and line 32. When i click on the element that has the methods the input method will setstate immidiatly and show in the console but the handlesign method will show the same state as previous and then on the second click on that element will setstate like it should.

As you click on any numbers i.e. 6 it will log ‘6’ but and then click on ‘+’ it will log '6 + ’ but when you hit ‘7’ after that it will log '6 + ’ again and then after you click ‘7’ for the second time it will log ‘6 + 7’ like it should i can not figure out why?

Link to code pen

Edit: updated link to show both console.log’s


#2

Can you outline the exact steps to recreate the problem you are experiencing?