Currently have a <Nav title='{title}' /> that has an animation and page title that changes on a new route.
For the animation to be carried over, the transition:persist needs to be applied. However, this persist applies to all children elements.
Is there a way to update the title but still keep the animation working through a navigation?
<Nav />:
---
interface Props {
title: string;
}
const { title } = Astro.props;
---
<nav id="nav">
<div id="navbar-left" transition:persist="navbar-left">
<a href="#" onclick="window.history.back(); return false;">
<Icon name="symbols/left-arrow" width={32} height={32} />
</a>
<h1 id="page-name">{title}</h1>
</div>
</nav>
In each page, the layout has the title prop, which is based to this <Nav /> in the Layout.astro.
that generalizes this approach.