Skip to content

fix(useInterval): remove window prefix from setInterval and clearInterval for platform independence#345

Open
eunwoo-levi wants to merge 1 commit intotoss:mainfrom
eunwoo-levi:fix/fix-useInterval-platform-independence
Open

fix(useInterval): remove window prefix from setInterval and clearInterval for platform independence#345
eunwoo-levi wants to merge 1 commit intotoss:mainfrom
eunwoo-levi:fix/fix-useInterval-platform-independence

Conversation

@eunwoo-levi
Copy link

Overview

Problem

useInterval used window.setInterval and window.clearInterval, which are browser-only APIs.
This breaks in non-browser environments like React Native and SSR.

Solution

Replace window.setInterval / window.clearInterval with the global setInterval /
clearInterval.

Checklist

  • Did you write the test code?
  • Have you run yarn run fix to format and lint the code and docs?
  • Have you run yarn run test:coverage to make sure there is no uncovered line?
  • Did you write the JSDoc?

…rval for platform independence

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant