Open tada-s opened 2 years ago
Thanks for the report @tada-s . It's a good workaround but would also need to exist inside the debounced promise. A more robust solution would be to move the setOptions
call to a function and have your mount check there.
In this scenario, the SelectSearch has a
getOptions
property set. When this component flashes (i.e., it is unmounted and mounted rapidly), the following warning raises on the browser:I found in useFetch.js Line 22 that
setFetching()
was the state update that causes this warning.Minimal working example
Workaround Add a new state
mounted
inuseFetch()
, add a useEffect managing the state mounted and fetch the option if is mounted.Do you think this workaround is good enough for a pull request?