<Swiper loop={false}>XXXXX</Swiper>
I didnot write any styles, but it warning.

I do not have any warning with no style in my swiper.
Can you fork the project and reproduce your warning in an example ?
I second @xiaobai1990zhan problem, I'm using the styled components lib, I'm not sure if it's related.
// tslint:disable-next-line:no-var-requires
const ViewPager = require('react-native-swiper');
export const OnboardTutorialViewPager: any = styled(ViewPager)`
`;
And in the component render method
render() {
return (
<OnboardTutorialViewPager>
<OnboardTutorialPageStyled>
<OnboardTutorialImageStyled
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Nietzsche187c.jpg/170px-Nietzsche187c.jpg' }}
/>
</OnboardTutorialPageStyled>
<OnboardTutorialPageStyled>
<OnboardTutorialImageStyled
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Nietzsche187c.jpg/170px-Nietzsche187c.jpg' }}
/>
</OnboardTutorialPageStyled>
<OnboardTutorialPageStyled>
<OnboardTutorialImageStyled
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Nietzsche187c.jpg/170px-Nietzsche187c.jpg' }}
/>
</OnboardTutorialPageStyled>
</OnboardTutorialViewPager>
);
}
It also complains about array of styles.
I'm experiencing a similar issue here. No warnings without any style though. But it complains if I assign custom styles, either style, activeDotStyle, or dotStyle.
Having the same issue
<Swiper
....
style={[styles.swiperImg]}
....
</Swiper>
Should be: style={ styles.swiperImg }
Don't know what's the issue with array of styles, but here is a workaround:
This piece of code
style={[firstStyle, secondStyle]}
is equivalent to
style={StyleSheet.flatten([firstStyle, secondStyle])}
and the warning is gone.
I get the same warning with styled-components.
@arribbar
This warning showing up when using styled-components (not with style prop).
I'm also facing that warning,
Warning: Failed prop type: Invalid prop `style` supplied to `_class`.
const SwiperView = styled(Swiper)``;
versions
RN: 0.55.4,
React: 16.3.1,
react-native-swiper: 1.5.13
I'm also having this issue with styled-components. Any update on this?
@leecade sorry to bring you up here, but I'm pretty sure this fix is something really quick for someone skilled enough to put this lib together. this warning has been haunting my console for a while now. could you please help out the poors using styled components together with swiper?
thanks a lot!
That is still a thing
Most helpful comment
I get the same warning with styled-components.