The issue that you are facing is the same as the one in the original post, where the value is extracted from the state, which will not be updated at this stage (within the onChange event). Please use the approach demonstrated in the following example instead: