Conversation
OS-jacobbell
approved these changes
Jul 10, 2026
OS-jacobbell
left a comment
Contributor
There was a problem hiding this comment.
Confirmed this fixes the issue and passes Ionic Framework's e2e tests.
Contributor
Author
|
@johnjenkins Would you have some time to review this one? Just for verification that it all makes sense |
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.
Resolves #485
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build) was run locally for affected output targetsnpm test) were run locally and passednpm run prettier) was run locally and passedPull request type
Please check the type of change your PR introduces:
What is the current behavior?
@lit/reactmaps React'sclassNameprop to the host'sclassattribute and rewrites it wholesale on every render. That wipes the classes the Stencil runtime manages on the host:hydrated,sc-*scope classes, mode classes, and state classes likeinteractive. So when an app drivesclassName(for example a form library setting Ionic'sion-invalid/ion-touchedvalidation classes), those app classes replace the runtime's classes instead of coexisting with them, and the component loses styling and hydration state.Issue URL:
What is the new behavior?
createComponentnow wraps the@lit/reactcomponent and withholdsclassName/classso React never writes theclassattribute directly. It reconciles the app's class value against the live host in a layout effect using a newmergeClassNameshelper. The merge keeps runtime-managed classes the app never set, appends new app classes, and removes only the app classes that were dropped since the previous render (tracked with apreviousClassNameref). It uses an isomorphic layout effect so it falls back touseEffectduring server rendering and doesn't warn.Does this introduce a breaking change?
Other information