I have an input field in one of my React Component which will take the inputs which will be email id's of users. I have a list of email id's saved in the server.So,when I type something in the input field, I want to have the suggestion of the email id's to appear below the input field from the currently existing list.So, what I have come up with is that I should use the localeCompare(string) function from javascript where I will have to use some condition like :
input_string.localeCompare(existing_string)
So,is this the correct way or is there some other way to proceed? And do I have to create a new component for displaying the suggestion below the input?
NOTE: I want my search to work in a similar manner like how google search works when we type some input in the search bar, the suggestion similar to the search string appears below.
