-
Notifications
You must be signed in to change notification settings - Fork 77
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
NewsSite-Next workload is generating keys for <li> element on the fly #422
Comments
PR to address this issue: #423 |
@lingyuncai - thanks for the issue and your solution. |
Hi, @flashdesignory Thanks for your new PRs, they indeed solve this issue in a more clean way and it looks great! Once these PRs are merged, do you know which version of Speedometer will include these changes? |
completed with #447 |
Since the data doesn't contain an
id
field for each item, the workload is now generating keys for each<li>
element dynamically while rendering, usinguuidv4()
.Speedometer/resources/newssite/news-next/src/components/article/article-content.jsx
Lines 23 to 32 in 3150f41
This will cause keys to never match up between renders, leading to these elements being recreated every time, which defeats the purpose of keys and slows the performance [1].
Besides, this implementation seems inconsistent with that of NewsSite-Nuxt, which uses
item.id
(which is undefined) as the key binding directly.Speedometer/resources/newssite/news-nuxt/components/atoms/ArticleContent.vue
Lines 29 to 34 in 3150f41
[1] https://react.dev/learn/rendering-lists#rules-of-keys
The text was updated successfully, but these errors were encountered: