JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="townSearcher" />

JavaScript

$(document).ready(function(){
    var townList = '[{"value":"1","label":"AAA"}, {"value":"2","label":"BBB"}]; //i create an array of towns in england
    
$("input#townSearcher").autocomplete({source:townList});

});