how to update react state in react app website from chrome console

I am trying to automate a script in a website that runs react application.

I need to automatically fill out inputs using the google chrome console.

The input updates a state when onChange is triggered, which means I have to enter the value manually.

Using document.element.value = 'some value' will not update the state.

I tried using window.document.getElementsByClassName('input class name')[0].value = 'some value'
the value got updated but when I submit it says the field is empty.

I assumed the page is using a react state that is updated on input onChange.

I think if it’s a static page, the line of code above should work.

Any ideas on how can I update the state from the google chrome console?

Thank you in advance.