Is there a better way to implement million options in dropdown. In my case there can be more than one million users and I need to select one user at a time. I have one choice, make asynchronous call for each letter when typing and I can filter the users. Is there any other methods to implement? If I bind all the options to dropdown, will it make my app slow?
You can do it in 2 ways. One is what you already said yourself. Making async calls. Or you can also do it a simpler way, This will still have a huge performance boost. It is still not very advisable to filter on the client-side for a million items. But nonetheless, it's possible and I haven't seen any major performance hit.
Use a state variable to maintain what you are going to render and another static variable to maintain your entire million collection.
On search, you filter that one million list and assign it to the state variable.
Tip: Make sure your filter method doesn't return more than say, 1000 items at any moment, this will force the user to enter more characters to search and it will keep the UI smooth.