We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useInterval clear后,如何重启?
The text was updated successfully, but these errors were encountered:
根据源码,更新 delay 即可
useEffect(() => { if (!isNumber(delay) || delay < 0) return; if (immediate) { fnRef.current(); } timerRef.current = setInterval(() => { fnRef.current(); }, delay); return () => { if (timerRef.current) { clearInterval(timerRef.current as NodeJS.Timer); } }; }, [delay]);
Sorry, something went wrong.
@nuonuonuonuoyan nu 解决你的问题了不?
有问题,如果clear后重启时delay不变,那么定时器重启不了
合理,不过加这个需要改动 api 了,下个大版本加
No branches or pull requests
useInterval clear后,如何重启?
The text was updated successfully, but these errors were encountered: