Skip to content

key is more reliable with child components #2699

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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

weaverryan
Copy link
Member

Q A
Bug fix? yes
New feature? no
Docs? yes
Issues Fix #1643
License MIT

I couldn't track down why, but for child components, key is more reliable. When id is used and a child requires re-rendering (because input props changed), the dummy element returned by https://github.com/symfony/ux/blob/2.x/src/LiveComponent/src/EventListener/InterceptChildComponentRenderSubscriber.php will not have an id, but with key it will. Smells like a bug, but key works

@carsonbot carsonbot added Bug Bug Fix Status: Needs Review Needs to be reviewed labels Apr 27, 2025
@smnandre
Copy link
Member

Do you have a concrete example/setup so we can track this done later ?

@smnandre smnandre added docs Improvements or additions to documentation LiveComponent Status: Reviewed Has been reviewed by a maintainer and removed Bug Bug Fix Status: Needs Review Needs to be reviewed labels Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error: The data-live-preserve attribute requires an id attribute
3 participants