Skip to content

Bug: ViewTransition name prop does not support numerical prefixes #33015

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

Open
roarosa opened this issue Apr 24, 2025 · 2 comments
Open

Bug: ViewTransition name prop does not support numerical prefixes #33015

roarosa opened this issue Apr 24, 2025 · 2 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@roarosa
Copy link

roarosa commented Apr 24, 2025

ViewTransition does not animate if a name prop starting with a number is provided. Presumably this is because the name is being used as a CSS class, but that is not obvious from the documentation.

React version: experimental

Steps To Reproduce

  1. Create a ViewTransition with the name "1name" that wraps an element
  2. Insert or remove the ViewTransition

Link to code example: https://codesandbox.io/p/sandbox/hopeful-dawn-cfgv64

The current behavior

Animation does not fire and no errors or warnings present

The expected behavior

One of the following:

  1. The ViewTransition applies (e.g. by escaping the name)
  2. An warning is logged for invalid ViewTransition name
  3. The React docs are updated to call out that name must be a valid CSS name
@roarosa roarosa added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 24, 2025
@aakashkumar001
Copy link

hey, @roarosa can i fix this issue!

@valtism
Copy link

valtism commented May 15, 2025

Oh, I was playing around with view transitions and could not work out why roughly half the time my components (named by UUID) were not animating. Turns out it's not quite half the time, but more precisely 10 times out of 16!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants