gluestack-ui icon indicating copy to clipboard operation
gluestack-ui copied to clipboard

The colors item does not exist for the LinearGradient.

Open k22pr opened this issue 1 year ago • 2 comments

Description

The colors item does not exist for the LinearGradient.

CodeSandbox/Snack link

No response

Steps to reproduce

An error occurs when using LinearGradient to specify colors.

<LinearGradient
                  colors={["#fff", "#F37C62"]} <-- error
                  w={layout.rw(168)}
                  aspectRatio={1}
                  borderRadius={layout.rw(100)}
                  justifyContent="center"
                  alignItems="center"
                >

I get the same error when I use the official documentation code.

Is there something I'm doing wrong?

<VStack alignItems="center" space="lg">
            <LinearGradient
              p="$16"
              colors={['$purple400', '$blue400', '$pink300']}  <-- error
              borderRadius="$md"   start= {[1,1]}
            end= {[0, 1]}
                   >

gluestack-ui Version

1.0.33

Platform

  • [X] Expo
  • [ ] React Native CLI
  • [ ] Next
  • [ ] Web
  • [X] Android
  • [ ] iOS

Other Platform

No response

Additional Information

No response

k22pr avatar Jan 04 '24 04:01 k22pr

Hey @k22pr, Thanks for reporting the issue. We will look into it.

ankit-tailor avatar Feb 14 '24 10:02 ankit-tailor

I get the same error, it comes from the DimensionValue type not accepting Number[] or String[] values. Happens the same with start and end prop types.

mikevb3 avatar Feb 25 '24 23:02 mikevb3