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:
parent
dddbb09fe0
commit
459f74bc71
2 changed files with 8 additions and 0 deletions
5
.changeset/pretty-oranges-heal.md
Normal file
5
.changeset/pretty-oranges-heal.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Adds an error message for non-string transition:name values
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue