Skip to content

Commit 9eaed32

Browse files
committed
fix: scroll view bug for react native gesture handler
1 parent a4eaf4d commit 9eaed32

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

docs/v3/cn/qa.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- [expo-updates 的问题](#expo-updates-的问题)
1818
- [创建 expo 项目 集成 uikit 问题](#创建-expo-项目-集成-uikit-问题)
1919
- [flipper compilation problem](#flipper-compilation-problem)
20+
- [ScrollView from react-native-gesture-handler](#scrollview-from-react-native-gesture-handler)
2021

2122
# 问题列表
2223

@@ -116,3 +117,7 @@ Showing Recent Errors Only
116117
The easiest way is to add the header file `#include <functional>` in `FlipperTransportTypes.h`
117118
118119
Reference: [Debugging React Native apps with Flipper is deprecated in React Native 0.73. We will eventually remove out-of-the box support for JS debugging via Flipper.](https://reactnative.dev/docs/debugging)
120+
121+
#### ScrollView from react-native-gesture-handler
122+
123+
ERROR Error: NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.

docs/v3/en/qa.en.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- [Issues with `expo-updates`](#issues-with-expo-updates)
1717
- [Create expo project and integrate uikit problem](#create-expo-project-and-integrate-uikit-problem)
1818
- [flipper compile question](#flipper-compile-question)
19+
- [ScrollView from react-native-gesture-handler](#scrollview-from-react-native-gesture-handler)
1920

2021
# Question List
2122

@@ -113,3 +114,7 @@ In macOS 14.6.1 with Xcode 15.4, compiling react-native 0.71.11 with flipper 0.1
113114
The simplest solution is to add the header file #include <functional> in FlipperTransportTypes.h.
114115
115116
Reference: Debugging React Native apps with Flipper is deprecated in React Native 0.73. We will eventually remove out-of-the box support for JS debugging via Flipper.
117+
118+
#### ScrollView from react-native-gesture-handler
119+
120+
ERROR Error: NativeViewGestureHandler must be used as a descendant of GestureHandlerRootView. Otherwise the gestures will not be recognized. See https://docs.swmansion.com/react-native-gesture-handler/docs/installation for more details.

packages/react-native-chat-uikit/src/container/Container.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from 'react';
22
import { Platform } from 'react-native';
33
import DeviceInfo from 'react-native-device-info';
4+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
45
import { SafeAreaProvider } from 'react-native-safe-area-context';
56

67
import { ChatContextProvider } from '../chat';
@@ -180,7 +181,11 @@ export function Container(props: ContainerProps) {
180181
<SimpleToastContextProvider>
181182
<ToastViewContextProvider>
182183
<AlertContextProvider>
183-
<SafeAreaProvider>{children}</SafeAreaProvider>
184+
<SafeAreaProvider>
185+
<GestureHandlerRootView>
186+
{children}
187+
</GestureHandlerRootView>
188+
</SafeAreaProvider>
184189
</AlertContextProvider>
185190
</ToastViewContextProvider>
186191
</SimpleToastContextProvider>

0 commit comments

Comments
 (0)