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

web-react: Avoid using useLayoutEffect hook on the server side #1129

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

literat
Copy link
Collaborator

@literat literat commented Nov 5, 2023

Description

useLayoutEffect does not work on the server side, so we must use useEffect instead.
However we can use both by wrapping them to new useIsomorphicLayoutEffect hook which detects the browser environment.

Additional context

Issue reference

https://jira.lmc.cz/browse/DS-1004


Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Follow the PR Title/Commit Message Convention.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@literat literat requested review from pavelklibani and a team as code owners November 5, 2023 07:57
Copy link

netlify bot commented Nov 5, 2023

Deploy Preview for spirit-design-system-demo canceled.

Name Link
🔨 Latest commit f548848
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-demo/deploys/654b6ff24ff33f00081f17aa

@github-actions github-actions bot added the bug Something isn't working label Nov 5, 2023
Copy link

netlify bot commented Nov 5, 2023

Deploy Preview for spirit-design-system-validations canceled.

Name Link
🔨 Latest commit f548848
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-validations/deploys/654b6ff2704892000871681c

Copy link

netlify bot commented Nov 5, 2023

Deploy Preview for spirit-design-system-storybook ready!

Name Link
🔨 Latest commit f548848
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/654b6ff248d9230008c222e8
😎 Deploy Preview https://deploy-preview-1129--spirit-design-system-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Nov 5, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit f548848. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 3 targets

Sent with 💌 from NxCloud.

Copy link

netlify bot commented Nov 5, 2023

Deploy Preview for spirit-design-system-react ready!

Name Link
🔨 Latest commit f548848
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-react/deploys/654b6ff22801f0000973038e
😎 Deploy Preview https://deploy-preview-1129--spirit-design-system-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@coveralls
Copy link

coveralls commented Nov 5, 2023

Coverage Status

coverage: 84.893% (-11.6%) from 96.46%
when pulling f548848 on fix/DS-1004-use-isomorphic-layout-effect
into 8e8ea36 on main.

@literat literat requested a review from crishpeen November 6, 2023 16:35
Copy link
Contributor

@pavelklibani pavelklibani left a comment

Choose a reason for hiding this comment

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

🤩

@literat literat force-pushed the fix/DS-1004-use-isomorphic-layout-effect branch from 5fe5531 to f548848 Compare November 8, 2023 11:24
@literat literat merged commit ea9f333 into main Nov 8, 2023
30 checks passed
@literat literat deleted the fix/DS-1004-use-isomorphic-layout-effect branch November 8, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants