879479119 / react-native-shadow

A SVG shadow component powered with react-native-svg,which can provide shadow on Android like iOS ^_^
MIT License
612 stars 82 forks source link

Invalid attempt to spread non-iterable instance #46

Open rawsly opened 4 years ago

rawsly commented 4 years ago

Giving this error while using BorderShadow that is wrapping a View. Code:

`

Test
    </BorderShadow>`

where 'feedShadow' is: const feedShadow = { width: screenWidth - 40, color: COLORS.BLACK, border: 10, opacity: 0.1, side: 'top', inset: false };

The error points last line of this code:

`return [ <Svg height={lineWidth} width={width+lineWidth} style={{position:"absolute",top:(inset?0:-lineWidth)}}>

{linear('BorderTop')} {linear('BorderTopInset')}
                                <Rect x={0} y={0} width={width} height={lineWidth} fill={`url(#top${inset?"-inset":""})`} />
                            </Svg>,
                            ...children
                        ]`
Jamyth commented 4 years ago

There is a temporary solution for this

`

{[ ]}

`

changyu2hao commented 4 years ago

how to set the key to this array?