File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 5
5
import * as React from "react" ;
6
6
import { StaggerBaseDef , TweenWithChildrenDef , TweenWithTargetDef } from "../../types" ;
7
7
import { Animation } from "../animation" ;
8
+ import { isDev } from "../../util" ;
8
9
9
10
export function Stagger (
10
11
props : StaggerBaseDef & {
@@ -33,7 +34,11 @@ export function Stagger({
33
34
34
35
const timeline = React . useMemo ( ( ) => {
35
36
if ( tween ?. start === undefined || tween ?. end === undefined ) {
36
- throw new Error ( 'Stagger must have start and end' ) ;
37
+ if ( isDev ) {
38
+ console . warn ( 'Stagger needs a start and end value' ) ;
39
+ }
40
+
41
+ return [ ] ;
37
42
}
38
43
39
44
return getStaggeredTimeline (
@@ -135,8 +140,8 @@ export function Stagger({
135
140
}
136
141
}
137
142
) ;
138
- } else {
139
- throw new Error ( 'Stagger target must be an array' ) ;
143
+ } else if ( isDev ) {
144
+ console . warn ( 'Stagger target must be an array' ) ;
140
145
}
141
146
}
142
147
Original file line number Diff line number Diff line change @@ -103,3 +103,5 @@ export function getValidAt(at: number) {
103
103
}
104
104
return at ;
105
105
}
106
+
107
+ export const isDev = process . env . NODE_ENV === "development" ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " https://turborepo.org/schema.json" ,
3
+ "globalEnv" : [" NODE_ENV" ],
3
4
"pipeline" : {
4
5
"build" : {
5
6
"dependsOn" : [" ^build" ],
You can’t perform that action at this time.
0 commit comments