Skip to content
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

Merged
merged 5 commits into from
Aug 1, 2022
Merged

Conversation

shanpriyan
Copy link
Contributor

@shanpriyan shanpriyan commented Jul 29, 2022

  • Fixed timeoutId type (setTimeout returns a number in browser and Timeout object in node)
  • Removed window. prefix, since it might break during SSR

@vercel
Copy link

vercel bot commented Jul 29, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jul 31, 2022 at 5:42AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jul 31, 2022 at 5:42AM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 29, 2022
Copy link
Member

@zurfyx zurfyx left a 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);
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@thegreatercurve thegreatercurve merged commit 570aa26 into facebook:main Aug 1, 2022
@shanpriyan shanpriyan deleted the fix/type-for-timeoutid branch August 1, 2022 10:23
thegreatercurve pushed a commit that referenced this pull request Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants