react-select-async-paginate icon indicating copy to clipboard operation
react-select-async-paginate copied to clipboard

when options and loadOptions both are used loadOptions is not gettiing call?

Open Rahulk4128 opened this issue 1 year ago • 2 comments

when you pass two props options and loadOptions in this case loadOptions is not getting called initially. Can I add some more options to the loadOptions cache options? any help will be highly appreciated. Thank you very much.

Rahulk4128 avatar Jun 10 '24 13:06 Rahulk4128

Hello. Could you please explain how you want this to work? Why do you need the initial call of loadOptions if you already have the initial options?

vtaits avatar Jun 18 '24 07:06 vtaits

I ran into this as well. I accidentally had options specified and it didn't behave incorrectly until the project was built. Running it in dev mode in vite called the loadOptions and worked normally. In my case I am fetching all the options and then using the loadOptions to boost the performance of the select drop down by not showing all the options at once. I reworked an existing wrapping component for the dropdown and had accidently left the options prop in there and it worked fine until I deployed it to production. Removing the options prop fixed the issue but it caught me off guard. It was strange that it behaved differently in production vs locally. It might be a good idea to either remove the options prop, warn on it, or fix the difference between local and production. I am not sure what the OP is getting at for his use case.

jasekiw avatar Feb 17 '25 18:02 jasekiw