How to show sugession container on input focus?

I am trying to make an auto search suggestion in react.
I want to know how can i enable a searchsuggestion container on input focus and hide if it’s clicked anywhere outside.

hi @Deepak8717 have a look at the Codepen
react provides onFocus and onBlur for that purpose.

the example uses local data, but if you are using some api to fetch data, make sure to use debounce methods .