michael-s-molina commented on PR #21316:
URL: https://github.com/apache/superset/pull/21316#issuecomment-1249561245

   > > Is there a reason for removing AsyncSelect useEffect dependencies?
   > 
   > @michael-s-molina Because fetchPage kept changing while initializing due 
to the object dependencies, useEffect has been triggered multiple times which 
causes unnecessary `fetchPage` calls.
   > 
   > I made [a 
change](https://github.com/apache/superset/pull/21316/commits/243ba07e55d24eb3c007f58557ddde68dcd139e9)
 to reduce and fix the dependencies for fetchPage and rollback this useEffect 
dependencies.
   
   @justinpark We can't add the responsibility of the immutability of the 
`options` to the Select component because there are some cases where we want to 
fire the requests again when the function changes. To fix your problem, you 
just need to make sure `options` only change when you in fact want them to. 
This is generally accomplished by the use of `useMemo` or `useCallback` on the 
parent component depending on the case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to