-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
[v4] "Warning: useLayoutEffect does nothing on the server" when using SSR #152
Comments
That's new for me, but I'm not surprised too much. It was introduced in wojtekmaj/react-date-picker@4de8245 and the reason for this effect is to apply CSS |
Could you then make the component only render on the client, as the React devs recommend? Should make no difference in terms of behavior. The warning spam kinda makes it impossible to work, I had to downgrade the package for now. |
Sorry, which parts of the docs, or which post, are you referring to? |
Sorry, I should've highlighted that. The error message links to this page: https://reactjs.org/link/uselayouteffect-ssr |
Thanks! Neither of these options are appealing to me.
The only solution that makes any sense to me is this one - I'll go with this. |
Fixed via wojtekmaj/react-date-picker@e95da80 - will be resolved with the next React-Date-Picker release. Note: React-DateRange-Picker will not update React-Date-Picker automatically - you'll have to update it yourself e.g. using |
For legacy versions of Yarn, as far as I can remember, the command you proposed would be correct. :) |
<h3>Snyk has created this PR to upgrade react-datetime-picker from 4.2.0 to 4.2.1.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **1 version** ahead of your current version. - The recommended version was released **22 days ago**, on 2023-04-01. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>react-datetime-picker</b></summary> <ul> <li> <b>4.2.1</b> - <a href="https://snyk.io/redirect/github/wojtekmaj/react-datetime-picker/releases/tag/v4.2.1">2023-04-01</a></br><h2>Bug fixes</h2> <ul> <li>Pinned React-Calendar version to 4.0.0 to fix a bug with TypeScript types.</li> </ul> </li> <li> <b>4.2.0</b> - <a href="https://snyk.io/redirect/github/wojtekmaj/react-datetime-picker/releases/tag/v4.2.0">2023-01-18</a></br><h2>What's new?</h2> <ul> <li>Added support for <code>data-testid</code> prop.</li> <li>Increased compatibility with Deno (replaced <code>typeof window …</code> checks with <code>typeof document …</code> checks).</li> </ul> <h2>What's changed?</h2> <ul> <li>Replaced Less with CSS. Don't worry - the CSS produced didn't change, we just have one less tool in our stack.</li> </ul> <h2>Bug fixes</h2> <ul> <li>Fixed "Warning: useLayoutEffect does nothing on the server" warning when using SSR (see: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1429902882" data-permission-text="Title is private" data-url="wojtekmaj/react-daterange-picker#152" data-hovercard-type="issue" data-hovercard-url="/wojtekmaj/react-daterange-picker/issues/152/hovercard" href="https://snyk.io/redirect/github/wojtekmaj/react-daterange-picker/issues/152">wojtekmaj/react-daterange-picker#152</a>).</li> <li>Fixed divider and leading zero positioning.</li> <li>Fixed native calendar and time picker sometimes showing on Safari.</li> </ul> </li> </ul> from <a href="https://snyk.io/redirect/github/wojtekmaj/react-datetime-picker/releases">react-datetime-picker GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>react-datetime-picker</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/wojtekmaj/react-datetime-picker/commit/719e9d6ab0e131a891ed69da14664cb00f2d1f57">719e9d6</a> v4.2.1</li> </ul> <a href="https://snyk.io/redirect/github/wojtekmaj/react-datetime-picker/compare/fca0ce422a7853ad78a38eb5a2d273fa2b9e547d...719e9d6ab0e131a891ed69da14664cb00f2d1f57">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIyYjYxMjJkYS02ZjBjLTQ0MjYtOTVhYy03MTk5ZmI4OWQ2MGYiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjJiNjEyMmRhLTZmMGMtNDQyNi05NWFjLTcxOTlmYjg5ZDYwZiJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/scudette/project/76f4d127-566b-42ef-86f4-bdcbc92b90b4?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/scudette/project/76f4d127-566b-42ef-86f4-bdcbc92b90b4/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/scudette/project/76f4d127-566b-42ef-86f4-bdcbc92b90b4/settings/integration?pkg=react-datetime-picker&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"2b6122da-6f0c-4426-95ac-7199fb89d60f","prPublicId":"2b6122da-6f0c-4426-95ac-7199fb89d60f","dependencies":[{"name":"react-datetime-picker","from":"4.2.0","to":"4.2.1"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/scudette/project/76f4d127-566b-42ef-86f4-bdcbc92b90b4?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"76f4d127-566b-42ef-86f4-bdcbc92b90b4","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2023-04-01T14:18:27.372Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) --->
The text was updated successfully, but these errors were encountered: