Hi, I really likes your all the post. You explain very well and in simple language.🙂
I have following doubt.
Search input field is controlled component. It is controlled by searchTerm state. It is setting in onchange only.
But I think we need to set it in handleSuggestionClick function also.
That means , if searchTerm= 'can'
And if I choose Canada from suggested drop down.
Then , selectedCountry = Canada ( which you are doing). But searchTerm= Canada ( I think you missed this in coding. Still it is 'can' only in coding).
Correct me if I wrong.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, I really likes your all the post. You explain very well and in simple language.🙂
I have following doubt.
Search input field is controlled component. It is controlled by searchTerm state. It is setting in onchange only.
But I think we need to set it in handleSuggestionClick function also.
That means , if searchTerm= 'can'
And if I choose Canada from suggested drop down.
Then , selectedCountry = Canada ( which you are doing). But searchTerm= Canada ( I think you missed this in coding. Still it is 'can' only in coding).
Correct me if I wrong.