JSFiddle - React, Tailwind, and code Playground
HTML
<input class="btn-input order-count" type="text" >
JavaScript
$('body').on('click keypress', '.btn-input', function(key) {
$this = $(this);
$maxLen = 2;
if (key.charCode < 48 || key.charCode > 57) return false;
if ($this.val().length > $maxLen)
$this.val($this.val().substr(0, $maxLen));
});