[Glitch] Enforce React Rules of Hooks with eslint

Port b785500809 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
th-downstream
Renaud Chaput 2 years ago committed by Claire
parent 4e88d37759
commit a7d51b92f3

@ -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));
});
};

@ -72,6 +72,7 @@ const mapDispatchToProps = (dispatch, { onPickEmoji }) => ({
},
onPickEmoji: emoji => {
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
dispatch(useEmoji(emoji));
if (onPickEmoji) {

@ -26,6 +26,7 @@ const mapDispatchToProps = dispatch => ({
},
onClose (value) {
// eslint-disable-next-line react-hooks/rules-of-hooks -- this is not a react hook
dispatch(useLanguage(value));
},

Loading…
Cancel
Save