kidjp85 / react-id-swiper

A library to use idangerous Swiper as a ReactJs component which allows Swiper's modules custom build
https://react-id-swiper.ashernguyen.site/
MIT License
1.49k stars 154 forks source link

mix static and dynamic slides (typescript issue) #481

Open dartess opened 3 years ago

dartess commented 3 years ago

OK:

<ReactIdSwiper>
    <div />
    <div />
    <div />
</ReactIdSwiper>

OK:

<ReactIdSwiper>
    {[1,2,3].map(() => (
        <div />
    ))}
</ReactIdSwiper>

FAIL:

<ReactIdSwiper>
    <div />
    {[1,2,3].map(() => (
        <div />
    ))}
</ReactIdSwiper>
TS2739: Type 'Element[]' is missing the following properties from type 'ReactElement  ReactElement  Component )> | null) | (new (props: any) => Component )>': type, props, key