Fix console errors - hydration from form & iframe#937
Merged
Conversation
Contributor
|
Preview deployment: https://fix-form-hydration-error.preview.avy-fx.org |
Contributor
|
🚀 This is included in version v1.8.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix a React hydration error caused by the Form block generating a random UUID on each render via
generateInstanceId().Also fixes iframe error suggestion to add
allow-presentationYouTube "Watch on YouTube" button:
allow-popups— permits the iframe to open new windows/tabs at allallow-popups-to-escape-sandbox— lets those opened windows/tabs run without inheriting the sandbox restrictionsWithout
allow-popups, the "Watch on YouTube" link would be blocked entirely. Withoutallow-popups-to-escape-sandbox, it opens but the new tab is still sandboxed, causing the error.Related Issues
Fixes #861
Issues
Form Hydration error


iframe error
Key Changes
generateInstanceId()(which calleduuidv4()) with React'suseId()hook, which produces stable, SSR-safe IDsgenerateInstanceIdutilityallow-presentationandallow-popups-to-escape-sandboxtoGenericEmbedHow to test
Video
https://www.loom.com/share/01a2933b7559456986295cce846a0a89