Skip to content

Fix hydrated innerHTML with attribute spreads#2742

Open
puneetdixit200 wants to merge 1 commit into
solidjs:mainfrom
puneetdixit200:fix-hydrated-innerhtml-spread
Open

Fix hydrated innerHTML with attribute spreads#2742
puneetdixit200 wants to merge 1 commit into
solidjs:mainfrom
puneetdixit200:fix-hydrated-innerhtml-spread

Conversation

@puneetdixit200
Copy link
Copy Markdown

Fixes #2737.

This prevents an attribute-only spread from installing a child reconciliation effect when the spread props do not include child-bearing props. During hydration, that effect could clear existing innerHTML content on the first reactive spread update.

Added a regression test that hydrates server-rendered innerHTML, updates a spread-only data attribute, and verifies the content remains intact.

Verification:

  • pnpm --dir packages/solid test web/test/element.spec.tsx
  • git diff --check

Note: pnpm --dir packages/solid exec tsc --project web/tsconfig.build.json was attempted in a fresh checkout, but it requires generated local package links/types first and failed before checking this change.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 4, 2026

⚠️ No Changeset found

Latest commit: 25a01be

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

Spread on element with innerHTML clears content during reactive updates after SSR hydration

1 participant