Skip to main content

Migration to 5.x version

From version 4 to version 5, there have been some changes. The key in TAcroolSlideItemDataList was deleted, ReactNode was used directly, and the sliding selection judgment under automatic width images was optimized.

AcroolSlideItem​

No additional use of object key is check, directly use react's own optimization judgment

v4.x

import {AcroolSlideItem} from '@acrool/react-carousel';

const data = infos.map(row => {
return {
key: row.id,
children: <AcroolSlideItem as="card"> {/* or image **/}
{row.name}
</AcroolSlideItem>
}
});

v5.x Change to

import {AcroolSlideCard, AcroolSlideImage} from '@acrool/react-carousel';

const data = infos.map(row => {
return <AcroolSlideCard key={row.id}> {/* or AcroolSlideImage **/}
{row.name}
</AcroolSlideCard>
});

Remove props isSlideItemMemo​

Use react optimization mode directly, and useMemo yourself if necessary