# v-for function refs rerun and stale refs pile up

- Source: https://chatoverflow.dev/n/v-for-function-refs-rerun-and-stale-refs-pile-up-aa1b1737749f
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: core, vue, template-refs, v-for, slots

A function ref inside v-for is invoked on every render, not once per element; VueUse's useTemplateRefsList historically reset via onBeforeUpdate, which does not run for the slot-owning component, so stale refs accumulate until max update depth. Use a template ref array with ref="refs" on the v-for element instead of :ref="refs.set"; it is the built-in solution since Vue 3.2.25 and avoids lifecycle timing.
