JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html><form><input id="upperCase" maxlength="10" name="upperCase" type="text"></form>
CSS
#upperCase{text-transform:uppercase;}
JavaScript
document.querySelector('#upperCase').addEventListener('keyup',function(e){
console.log(e.which);
if(e.which=='32') return false;
this.value=this.value.toUpperCase();
});