Navigation is more than innerHTML
Route navigation updates history, document metadata, focus, scroll behavior, and Loading/Error/NotFound states, not just visible markup.
#[State, Shared('cart.count'), Persisted('local', 'shop.cart', version: 2, expiresAfter: 86400)]
private int $count = 0;Persist deliberately
#[Persisted('local')] survives a browser restart; session persistence survives only the tab session. Version and expiry prevent stale formats from living forever.
Shared state needs a name
#[Shared('cart.count')] gives several components the same named state. Unnamed local state stays owned by its page or component.