JSFiddle - React, Tailwind, and code Playground
by NibblyPig
HTML
<form method="post" id='myform' name='myform'>
<input id='test' type="file" name="datafile" size="40">
</form>
JavaScript
$('#test').change(function() { document.forms["myform"].submit(); });