score:0

return (
    <Autocomplete>
      <input
        type="text"
        placeholder="Type to search list"
        onChange={searchList}
        onFocus={() => showDropdown()}
      />
      <AiFillCaretDown className="icon" size={20} />
      {dropdownVisible && (
        <Dropdown>
          <SearchResults>
            {results.map((result) => (
              <Items
                key={result}
                onClick={() => {
                  //help me...
                  console.log(result);
                  hideDropdown();
                }}
              >
                {result}
              </Items>
            ))}
          </SearchResults>
        </Dropdown>
      )}
    </Autocomplete>
  );

score:0

const Items = (props) => {
  return <div onClick={props.onClick}>{props.children}</div>;
}

Related Query

More Query from same tag