Skip to content

Comments

Use comment content hash as key#26

Merged
luisdalmolin merged 1 commit intomainfrom
reactive-reactions
May 16, 2025
Merged

Use comment content hash as key#26
luisdalmolin merged 1 commit intomainfrom
reactive-reactions

Conversation

@nathanheffley
Copy link
Member

Currently, the comment-list polls for changes, but because Livewire is not reactive, it is only rendering new comments (or stops rendering deleted comments). Any comment that is edited or has new reactions doesn't display changes after the polling because the comment child element does not re-render due to the key not changing.

This PR has comments generate a hash made of the body content and an array of reaction's IDs. This way whenever the body or reactions change it will cause the comment element to re-render and display the new content.

This should resolve the remaining concerns in #9

@nathanheffley nathanheffley self-assigned this May 15, 2025
Copy link
Member

@luisdalmolin luisdalmolin left a comment

Choose a reason for hiding this comment

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

Nice one!

@luisdalmolin luisdalmolin merged commit b927f21 into main May 16, 2025
6 checks passed
@luisdalmolin luisdalmolin deleted the reactive-reactions branch May 16, 2025 10:02
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