Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM elements in react component with transition:persist directive do not update when hook triggers re-render #13287

Open
1 task
flocbit opened this issue Feb 21, 2025 · 1 comment
Labels
feat: view transitions Related to the View Transitions feature (scope) needs triage Issue needs to be triaged

Comments

@flocbit
Copy link

flocbit commented Feb 21, 2025

Astro Info

Astro                    v5.3.0
Node                     v23.6.1
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             @astrojs/mdx
                         astro-icon
                         @astrojs/sitemap
                         @astrojs/react

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When adding the transition:persist directive to a react component, state is maintained. However when a react hook triggers a re-render, the DOM elements are not updated.

See the Stackblitz where I added console log statements that show that the react component does re-render but the DOM elements are not updated.

What's the expected result?

The component should re-render when the hook changes.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2a65qjcy?file=src%2Fcomponents%2Fnavbar-report-selection.tsx

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 21, 2025
@ematipico ematipico added the feat: view transitions Related to the View Transitions feature (scope) label Feb 25, 2025
@ematipico
Copy link
Member

cc @martrapp and @matthewp for triaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: view transitions Related to the View Transitions feature (scope) needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants