JSFiddle - React, Tailwind, and code Playground
HTML
<input class="auto" type="text">
JavaScript
$('.auto').keyup(function() {
var $this = $(this),
value = $this.val().toLowerCase();
$this.val(value.replace(/^(.)|\s(.)/g, function(a) {
return a.toUpperCase();
}));
});