Random Link ¯\_(ツ)_/¯ | ||
May 28, 2024 | » | Of Stale UI and Re-renders
3 min; updated May 28, 2024
More than once, I’ve been surprised by a web component either showing data that should no longer be there, or not showing data that should be there. This page aims to reason through such cases for a better mental model of web components. Rendering Lists Both <search-bar> and <search-results> need to render a collection of N items. offers two options: looping, or using the repeat(items, keyFunction, itemTemplate) directive. const cards = html` ${cards.... |