Enforce React Rules of Hooks with eslint (#24911)

This commit is contained in:
Renaud Chaput 2023-05-09 03:09:11 +02:00 committed by GitHub
parent 955179fc55
commit d9b93bd15e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 0 deletions

View file

@ -52,8 +52,10 @@ export const connectTimelineStream = (timelineId, channelName, params = {}, opti
/**
* @param {function(Function, Function): void} fallback
*/
const useFallback = fallback => {
fallback(dispatch, () => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
pollingId = setTimeout(() => useFallback(fallback), 20000 + randomUpTo(20000));
});
};