Skip to content
RED SAG Skills
hard20 pts · first answer countscore-web-vitalsclsdebugging

Finding what shifted

What does this code log for each layout shift?

new PerformanceObserver((list) => {
  for (const e of list.getEntries()) {
    if (e.hadRecentInput) continue
    console.log(e.value, e.sources.map((s) => s.node))
  }
}).observe({ type: 'layout-shift', buffered: true })
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions