react-native-reanimated-carousel icon indicating copy to clipboard operation
react-native-reanimated-carousel copied to clipboard

Carousel inside a vertical scrollview was laggy and buggy, but no more after I did this using patch-pacakage

Open mufaddalhamidofficial opened this issue 4 months ago • 1 comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-reanimated-carousel/src/Carousel.tsx b/node_modules/react-native-reanimated-carousel/src/Carousel.tsx
index 980baac..c0c883e 100644
--- a/node_modules/react-native-reanimated-carousel/src/Carousel.tsx
+++ b/node_modules/react-native-reanimated-carousel/src/Carousel.tsx
@@ -202,33 +202,31 @@ const Carousel = React.forwardRef<ICarouselInstance, TCarouselProps<any>>(
     );
 
     return (
-      <GestureHandlerRootView>
-        <CTX.Provider value={{ props, common: commonVariables }}>
-          <ScrollViewGesture
-            key={mode}
-            size={size}
-            translation={handlerOffset}
-            style={[
-              styles.container,
-              {
-                width: width || "100%",
-                height: height || "100%",
-              },
-              style,
-              vertical
-                ? styles.itemsVertical
-                : styles.itemsHorizontal,
-            ]}
-            testID={testID}
-            onScrollBegin={scrollViewGestureOnScrollBegin}
-            onScrollEnd={scrollViewGestureOnScrollEnd}
-            onTouchBegin={scrollViewGestureOnTouchBegin}
-            onTouchEnd={scrollViewGestureOnTouchEnd}
-          >
-            {data.map(renderLayout)}
-          </ScrollViewGesture>
-        </CTX.Provider>
-      </GestureHandlerRootView>
+      <CTX.Provider value={{ props, common: commonVariables }}>
+        <ScrollViewGesture
+          key={mode}
+          size={size}
+          translation={handlerOffset}
+          style={[
+            styles.container,
+            {
+              width: width || "100%",
+              height: height || "100%",
+            },
+            style,
+            vertical
+              ? styles.itemsVertical
+              : styles.itemsHorizontal,
+          ]}
+          testID={testID}
+          onScrollBegin={scrollViewGestureOnScrollBegin}
+          onScrollEnd={scrollViewGestureOnScrollEnd}
+          onTouchBegin={scrollViewGestureOnTouchBegin}
+          onTouchEnd={scrollViewGestureOnTouchEnd}
+        >
+          {data.map(renderLayout)}
+        </ScrollViewGesture>
+      </CTX.Provider>
     );
   },
 );

This issue body was partially generated by patch-package.

mufaddalhamidofficial avatar Oct 08 '24 13:10 mufaddalhamidofficial