Replace headerBlock.id with different value#13768
Open
Conversation
shayneahchoon
approved these changes
Mar 5, 2026
hotinglok
commented
Mar 5, 2026
| {headerBlocks.map(headerBlock => ( | ||
| <PostHeadings key={headerBlock.id} headerBlock={headerBlock} /> | ||
| <PostHeadings | ||
| key={`${headerBlock.type}-${headerBlock.model?.blocks?.[0]?.model?.blocks?.[0]?.model?.text}`} |
Contributor
Author
There was a problem hiding this comment.
Main change here, the linting rule prevents this from using an index from the map. This should be unique enough as these headers seem to only usually consist of headlines and subheadlines.
Contributor
There was a problem hiding this comment.
thanks for highlighting the main change, LGTM!
Louis-Matsika
approved these changes
Mar 5, 2026
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 JIRA: N/A
Summary
There is currently ongoing work to add polling/automatically refreshing posts to Live pages. Part of this work is implementing the polling/client-side data fetching and it was found that the only difference between the post content from the Simorgh-BFF and the Stream module directly was the
idproperty added to all blocks.Most of the ids for the posts aren't being used, with only the
headerBlock.idbeing used as a reactkeyprop. Removing this would mean that we could either refetch the data directly from the Stream module (or at least require no transformation if we decide to use/create a new module for polling).Code changes
keyprop value withheaderBlock.type-headerBlock.text(e.g.headline-some presumably unique text).idfrom related fixture data. This shouldn't affect any tests on Simorgh, though the actual change to remove this is a FABL change done in another PR.Testing
Useful Links