From af61f0a1e8afd1c95c3d5bd2a13ab62eae26d5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Mesnil?= Date: Thu, 7 Aug 2025 22:57:04 +0200 Subject: [PATCH] chore: upgrade flash-list to v2 --- package.json | 2 +- src/components/List/index.tsx | 1 - src/components/VerticalList/index.tsx | 5 ++-- src/components/app/index/Overview/index.tsx | 11 +++++---- yarn.lock | 27 +++++---------------- 5 files changed, 16 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index fd9b8df..f578177 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@react-navigation/elements": "^2.4.0", "@react-navigation/native": "^7.1.6", "@react-navigation/stack": "^7.3.0", - "@shopify/flash-list": "1.7.6", + "@shopify/flash-list": "^2.0.0", "@tanstack/react-query": "^5.75.2", "axios": "^1.9.0", "date-fns": "^4.1.0", diff --git a/src/components/List/index.tsx b/src/components/List/index.tsx index c630020..073dee8 100644 --- a/src/components/List/index.tsx +++ b/src/components/List/index.tsx @@ -111,7 +111,6 @@ export function List({ paddingHorizontal: theme.space.marginList, }} data={dataFormatted} - estimatedItemSize={itemSize} horizontal ItemSeparatorComponent={renderSeparators} keyExtractor={(_, index: number) => diff --git a/src/components/VerticalList/index.tsx b/src/components/VerticalList/index.tsx index 7e598bb..a428e67 100644 --- a/src/components/VerticalList/index.tsx +++ b/src/components/VerticalList/index.tsx @@ -80,12 +80,13 @@ export function VerticalList({ (isLoading ? `loading_${id}_${index}` : `${id}_${index}`)} ListHeaderComponent={renderListHeaderComponent} numColumns={numColumns} diff --git a/src/components/app/index/Overview/index.tsx b/src/components/app/index/Overview/index.tsx index fb75435..2f5bbc7 100644 --- a/src/components/app/index/Overview/index.tsx +++ b/src/components/app/index/Overview/index.tsx @@ -26,10 +26,12 @@ export function Overview() { .flat() .slice(0, 5) - const itemSize = Dimensions.get('window').width - const onViewableItemsChanged = React.useCallback( - ({ viewableItems }: { viewableItems: ViewToken[] }) => { + ({ + viewableItems, + }: { + viewableItems: ViewToken[] + }) => { const active = viewableItems?.[0]?.index if (active || active === 0) { @@ -46,7 +48,7 @@ export function Overview() { item: { backdrop_path, id, media_type, name, overview, title }, }) => { return ( - + isLoading ? `loading_${index}_overview` : `${index}_${item.id}_overview` diff --git a/yarn.lock b/yarn.lock index e05e1d4..c8eeb79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2246,12 +2246,11 @@ resolved "https://registry.yarnpkg.com/@rtsao/scc/-/scc-1.1.0.tgz#927dd2fae9bc3361403ac2c7a00c32ddce9ad7e8" integrity sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g== -"@shopify/flash-list@1.7.6": - version "1.7.6" - resolved "https://registry.yarnpkg.com/@shopify/flash-list/-/flash-list-1.7.6.tgz#367e76866c71d1f1be0ff70f0b28be4bbfbcf595" - integrity sha512-0kuuAbWgy4YSlN05mt0ScvxK8uiDixMsICWvDed+LTxvZ5+5iRyt3M8cRLUroB8sfiZlJJZWlxHrx0frBpsYOQ== +"@shopify/flash-list@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@shopify/flash-list/-/flash-list-2.0.2.tgz#644748f883fccf8cf2e0ca251e0ef88673b89120" + integrity sha512-zhlrhA9eiuEzja4wxVvotgXHtqd3qsYbXkQ3rsBfOgbFA9BVeErpDE/yEwtlIviRGEqpuFj/oU5owD6ByaNX+w== dependencies: - recyclerlistview "4.2.3" tslib "2.8.1" "@sinclair/typebox@^0.27.8": @@ -6577,7 +6576,7 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash.debounce@4.0.8, lodash.debounce@^4.0.8: +lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== @@ -7568,7 +7567,7 @@ prompts@^2.0.1, prompts@^2.2.1, prompts@^2.3.2: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@15.8.1, prop-types@^15.8.1: +prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -7850,15 +7849,6 @@ react@19.0.0: resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd" integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ== -recyclerlistview@4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/recyclerlistview/-/recyclerlistview-4.2.3.tgz#14032e7ad2f24396e24d5b3060c6ba76b567f000" - integrity sha512-STR/wj/FyT8EMsBzzhZ1l2goYirMkIgfV3gYEPxI3Kf3lOnu6f7Dryhyw7/IkQrgX5xtTcDrZMqytvteH9rL3g== - dependencies: - lodash.debounce "4.0.8" - prop-types "15.8.1" - ts-object-utils "0.0.5" - redent@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-3.0.0.tgz#e557b7998316bb53c9f1f56fa626352c6963059f" @@ -8804,11 +8794,6 @@ ts-interface-checker@^0.1.9: resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== -ts-object-utils@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/ts-object-utils/-/ts-object-utils-0.0.5.tgz#95361cdecd7e52167cfc5e634c76345e90a26077" - integrity sha512-iV0GvHqOmilbIKJsfyfJY9/dNHCs969z3so90dQWsO1eMMozvTpnB1MEaUbb3FYtZTGjv5sIy/xmslEz0Rg2TA== - tsconfig-paths@^3.15.0: version "3.15.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4"