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

[sitecore-jss-react] Hydration error when render Link in Edit mode #1432

Merged
merged 2 commits into from
Apr 17, 2023

Conversation

illiakovalenko
Copy link
Contributor

@illiakovalenko illiakovalenko commented Apr 12, 2023

Description / Motivation

Use of html-react-parser is not needed, since we render children as a sibling to editable markup
The cause of the hydration error is that the server returns markup that includes additional space and &quot instead of brackets (fragment of the server response)
image
Using dangerouslySetInnerHTML property it's parsed and returned to the browser as expected
image

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate) Tested using connected/production modes in Editing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@illiakovalenko illiakovalenko changed the title [React] Hydration error when render Link in Edit mode [sitecore-jss-react] Hydration error when render Link in Edit mode Apr 12, 2023
@illiakovalenko illiakovalenko requested a review from a team April 12, 2023 21:22
Copy link
Contributor

@addy-pathania addy-pathania left a comment

Choose a reason for hiding this comment

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

Great solution, looks good. 👍🏼

@addy-pathania addy-pathania merged commit cd89296 into dev Apr 17, 2023
@addy-pathania addy-pathania deleted the bugfix/569946 branch April 17, 2023 19:35
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