-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
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
fix: timeoutId
type
#2735
fix: timeoutId
type
#2735
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
element.innerHTML = content; | ||
timer.current = setTimeout(cleanup, 1000); | ||
timer.current = window.setTimeout(cleanup, 1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use the window.
prefix (here and other occurrences, especially NPM packages), it will fail on some frameworks like Remix when loaded on the server-side, especially now that we support headless mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
timeoutId
type (setTimeout
returns a number in browser andTimeout
object in node)window.
prefix, since it might break during SSR