0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Adds an error message for non-string transition:name values (#10205)

This commit is contained in:
Martin Trapp 2024-02-23 15:00:52 +01:00 committed by GitHub
parent dddbb09fe0
commit 459f74bc71
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"astro": patch
---
Adds an error message for non-string transition:name values

View file

@ -91,6 +91,9 @@ export function renderTransition(
animationName: TransitionAnimationValue | undefined,
transitionName: string
) {
if (typeof (transitionName ?? '') !== 'string') {
throw new Error(`Invalid transition name {${transitionName}}`);
}
// Default to `fade` (similar to `initial`, but snappier)
if (!animationName) animationName = 'fade';
const scope = createTransitionScope(result, hash);