diff options
Diffstat (limited to 'src/components/LinearGradientBackground.tsx')
-rw-r--r-- | src/components/LinearGradientBackground.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/LinearGradientBackground.tsx b/src/components/LinearGradientBackground.tsx index f516b19f5..724df43f3 100644 --- a/src/components/LinearGradientBackground.tsx +++ b/src/components/LinearGradientBackground.tsx @@ -13,7 +13,11 @@ export function LinearGradientBackground({ }) { const gradient = gradients.sky.values.map(([_, color]) => { return color - }) + }) as [string, string, ...string[]] + + if (gradient.length < 2) { + throw new Error('Gradient must have at least 2 colors') + } return ( <LinearGradient colors={gradient} style={style}> |