JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" onKeyUp="Prevent(this.value)" id="testInput" />

JavaScript

function Prevent(value) {
    var x = document.getElementById("testInput");
    if (value == '0') {
        x.value = '';
    }
}