Content update on React navigation

Author: freganteCreated Jul 28, 2026Updated Sep 29, 2026
Labelsmeta

This issue is about two related bugs:

  • observe remains active on views where it shouldn't run (example)
  • components Svelte remain in memory and still listening to events like URL changes

Svelte component issue

When I mount() components the first time and then they're removed by GitHub, they're still in memory but dormant, potentially garbage collected if we're lucky.

However with self-updating components, they continue to self-update even when not attached to the document.

Repro

  1. Open https://github.com/refined-github/refined-github/blob/main/source/features/action-pr-link.tsx
  2. Click on the "Features" folder
  3. Click on another feature in the sidebar

the previous component is still updated in memory even if rendered nowhere. This specifically happens because GitHub is removing the first one, so observe will mount a new one.

Source: refined-github/refined-github