change value of a React input DOM using javascript code in a chrome extension or console

How to change react base input element using javaScript in an extension or in a chrome console debugger?

For example, i have put a sample React link here that has an input and submit button.
text
When i change input with keyboard it submits the right value but when i change input value by console “javaScript” it submits the old value yet and it doesn’t affect anything.
I will be grateful if you can help me. thank you.

When i change input with keyboard it submits the right value but when i change input value by console “javaScript” it submits the old value yet and it doesn’t affect anything.
I will be grateful if you can help me. thank you.

my js code:
inp=document.getElementsByClassName("input")[0].value=5 btn=document.getElementsByClassName("form-submit-button")[0] btn.click()