title: How to programmatically fill input elements built with React?
body: <p>I'm tasked with crawling website built with React. I'm trying to fill in input fields and submitting the form using javascript injects to the page (either selenium or webview in mobile). This works like a charm on every other site + technology but React seems to be a real pain.</p>
  
  <p>so here is a sample code </p>
  
  <pre><code>var email = document.getElementById( 'email' );
  email.value = 'example@mail.com';
  </code></pre>
  
  <p>I the value changes on the DOM input element, but the React does not trigger the change event.</p>
  
  <p>I've been trying plethora of different ways to get the React to update the state.</p>
  
  <pre><code>var event = new Event('change', { bubbles: true });
  email.dispatchEvent( event );
  </code></pre>
  
  <p>no avail</p>
  
  <pre><code>var event = new Event('input', { bubbles: true });
  email.dispatchEvent( event );
  </code></pre>
  
  <p>not working</p>
  
  <pre><code>email.onChange( event );
  </code></pre>
  
  <p>not working</p>
  
  <p>I cannot believe interacting with React has been made so difficult. I would greatly appreciate any help. </p>
  
  <p>Thank you</p>