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

Use isomorphic layout effect everywhere #3722

Merged
merged 3 commits into from
Sep 11, 2023

Conversation

mattcosta7
Copy link
Collaborator

@mattcosta7 mattcosta7 commented Sep 8, 2023

Describe your changes here.

Replace useLayoutEffect with useIsomorphicLayoutEffect and lint against useLayoutEffect usage
related to #3721

This doesn't close that issue, since Portal is still accessing document in its render function, but gets closer

Screenshots

Please provide before/after screenshots for any visual changes

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@mattcosta7 mattcosta7 requested review from a team and josepmartins September 8, 2023 21:07
@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2023

🦋 Changeset detected

Latest commit: a38d6e5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 100.69 KB (0%)
dist/browser.umd.js 101.27 KB (0%)

Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

Looks great 🚀

{
name: 'react',
importNames: ['useLayoutEffect'],
message:
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for adding this linter!

@mattcosta7 mattcosta7 added this pull request to the merge queue Sep 11, 2023
Merged via the queue into main with commit 0baa5a7 Sep 11, 2023
34 checks passed
@mattcosta7 mattcosta7 deleted the use-isomorphic-layout-effect-everywhere branch September 11, 2023 13:31
This was referenced Sep 11, 2023
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.

2 participants