This is the edited question after submitting the answer In this code, my file browser will now directly open but when I am submiting the final button then I am not getting the updated state. uploadImage() will be converting the image to base 64 and then update the value on the state. uploadCode() will be used to final send the