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

feat: replace useLayoutEffect in favor of useInsertionEffect #1559

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

juliajforesti
Copy link
Contributor

@juliajforesti juliajforesti commented Feb 12, 2025

Proposed changes (including videos or screenshots)

useInsertionEffect allows inserting elements into the DOM before any layout Effects fire.
It's indicated for inserting styles before any Effects fire that may need to read layout.

ref: https://react.dev/reference/react/useInsertionEffect

This PR replaces useLayoutEffect in favor of useInsertionEffect in Box component's useStyle hook and in styled package.

Issue(s)

Further comments

Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 6207253

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

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/fuselage Minor
@rocket.chat/styled Minor
@rocket.chat/logo 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

packages/styled/src/styled.ts Outdated Show resolved Hide resolved
@juliajforesti juliajforesti force-pushed the feat/useInsertionEffect branch from e07068a to 203c743 Compare February 12, 2025 14:16
@juliajforesti juliajforesti marked this pull request as ready for review February 12, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants