JSFiddle - React, Tailwind, and code Playground
HTML
<input type="checkbox" id="checkbox" name="checkbox" value="0" />
<input type='text' id='textbx' />
JavaScript
$('#checkbox').change(function(){
var c = this.checked ? $(this).val() : '';
$("#textbx").val(c);
});