From 455a530e25dfcea930e35821e2629f94817e3560 Mon Sep 17 00:00:00 2001 From: Abdullah Mzaien Date: Thu, 9 May 2024 11:48:53 +0300 Subject: [PATCH 1/2] fix: add new gestuer handler scrollView types --- package.json | 4 +++- src/FlashListProps.ts | 4 +++- yarn.lock | 34 ++++++++++++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 6d3b94acf..97b929604 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,8 @@ "peerDependencies": { "@babel/runtime": "*", "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-gesture-handler": "^2.16.2" }, "devDependencies": { "@babel/core": "^7.18.5", @@ -73,6 +74,7 @@ "prettier": "^2.7.1", "react": "18.2.0", "react-native": "0.72.10", + "react-native-gesture-handler": "~2.16.2", "react-test-renderer": "18.2.0", "typescript": "^4.7.4" }, diff --git a/src/FlashListProps.ts b/src/FlashListProps.ts index 77e6096ca..0c48d37c1 100644 --- a/src/FlashListProps.ts +++ b/src/FlashListProps.ts @@ -6,6 +6,7 @@ import { ViewabilityConfigCallbackPairs, ViewStyle, } from "react-native"; +import { NativeViewGestureHandlerProps } from "react-native-gesture-handler"; import { BlankAreaEventHandler } from "./native/auto-layout/AutoLayoutView"; import ViewToken from "./viewability/ViewToken"; @@ -144,7 +145,8 @@ export interface FlashListProps extends ScrollViewProps { */ renderScrollComponent?: | React.ComponentType - | React.FC; + | React.FC + | NativeViewGestureHandlerProps; /** * You can use `contentContainerStyle` to apply padding that will be applied to the whole content itself. diff --git a/yarn.lock b/yarn.lock index 7f78302db..d96ed0118 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1012,6 +1012,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@egjs/hammerjs@^2.0.17": + version "2.0.17" + resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124" + integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A== + dependencies: + "@types/hammerjs" "^2.0.36" + "@endemolshinegroup/cosmiconfig-typescript-loader@3.0.2": version "3.0.2" resolved "https://registry.yarnpkg.com/@endemolshinegroup/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-3.0.2.tgz#eea4635828dde372838b0909693ebd9aafeec22d" @@ -1934,6 +1941,11 @@ dependencies: "@types/node" "*" +"@types/hammerjs@^2.0.36": + version "2.0.45" + resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.45.tgz#ffa764bb68a66c08db6efb9c816eb7be850577b1" + integrity sha512-qkcUlZmX6c4J8q45taBKTL3p+LbITgyx7qhlPYOdOHZB7B31K0mXbP5YA7i7SgDeEGuI9MnumiKPEMrxg8j3KQ== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" @@ -4202,6 +4214,13 @@ hermes-profile-transformer@^0.0.6: dependencies: source-map "^0.7.3" +hoist-non-react-statics@^3.3.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -6233,7 +6252,7 @@ prompts@^2.0.1, prompts@^2.4.0: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@15.8.1, prop-types@^15.8.1: +prop-types@15.8.1, prop-types@^15.7.2, 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== @@ -6282,7 +6301,7 @@ react-devtools-core@^4.27.2: resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== -react-is@^16.13.1: +react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -6292,6 +6311,17 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-native-gesture-handler@~2.16.2: + version "2.16.2" + resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.16.2.tgz#032bd2a07334292d7f6cff1dc9d1ec928f72e26d" + integrity sha512-vGFlrDKlmyI+BT+FemqVxmvO7nqxU33cgXVsn6IKAFishvlG3oV2Ds67D5nPkHMea8T+s1IcuMm0bF8ntZtAyg== + dependencies: + "@egjs/hammerjs" "^2.0.17" + hoist-non-react-statics "^3.3.0" + invariant "^2.2.4" + lodash "^4.17.21" + prop-types "^15.7.2" + react-native@0.72.10: version "0.72.10" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.72.10.tgz#4a796d1b14ab78dcc6520292ff4e66fded0ce3f3" From 57da97ad8ce53d0505d70438988f908cf726875f Mon Sep 17 00:00:00 2001 From: Abdullah Mzaien Date: Thu, 9 May 2024 19:08:31 +0300 Subject: [PATCH 2/2] chore: remove unneeded peerDep --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 97b929604..6cebfa9f5 100644 --- a/package.json +++ b/package.json @@ -54,8 +54,7 @@ "peerDependencies": { "@babel/runtime": "*", "react": "*", - "react-native": "*", - "react-native-gesture-handler": "^2.16.2" + "react-native": "*" }, "devDependencies": { "@babel/core": "^7.18.5",