From f4e487ef562c39c5d67b6130e74306c9a7ec9f77 Mon Sep 17 00:00:00 2001 From: Rui Ying Date: Wed, 18 Sep 2019 16:14:28 +0800 Subject: [PATCH] Fix crash on scroll by remove gesture handler import --- src/components/InteractablePreviewWrapper.tsx | 12 +++++++----- src/screens/CoursesScreen.tsx | 3 +-- src/screens/NoticesScreen.tsx | 3 +-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/InteractablePreviewWrapper.tsx b/src/components/InteractablePreviewWrapper.tsx index 3a3f2233..e9e69e97 100644 --- a/src/components/InteractablePreviewWrapper.tsx +++ b/src/components/InteractablePreviewWrapper.tsx @@ -1,17 +1,19 @@ import * as Haptics from 'expo-haptics'; import React, {PropsWithChildren} from 'react'; -import {Platform, TouchableNativeFeedback} from 'react-native'; -import {TouchableHighlight} from 'react-native-gesture-handler'; +import { + Platform, + TouchableNativeFeedback, + TouchableHighlight, +} from 'react-native'; import Interactable from 'react-native-interactable'; -import {TouchablePreview} from 'react-native-navigation/lib/dist/adapters/TouchablePreview'; import Colors from '../constants/Colors'; import {useDarkMode} from 'react-native-dark-mode'; export interface IInteractablePreviewWrapperProps { readonly pinned?: boolean; readonly onPinned?: (pin: boolean) => void; - readonly onPress?: TouchablePreview['props']['onPress']; - readonly onPressIn?: TouchablePreview['props']['onPressIn']; + readonly onPress?: TouchableHighlight['props']['onPress']; + readonly onPressIn?: TouchableHighlight['props']['onPressIn']; readonly dragEnabled: boolean; } diff --git a/src/screens/CoursesScreen.tsx b/src/screens/CoursesScreen.tsx index d6322fb6..d8bf0f31 100644 --- a/src/screens/CoursesScreen.tsx +++ b/src/screens/CoursesScreen.tsx @@ -1,7 +1,6 @@ import * as Haptics from 'expo-haptics'; import React, {useEffect} from 'react'; -import {RefreshControl, SafeAreaView} from 'react-native'; -import {FlatList} from 'react-native-gesture-handler'; +import {RefreshControl, SafeAreaView, FlatList} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {connect} from 'react-redux'; import CourseCard from '../components/CourseCard'; diff --git a/src/screens/NoticesScreen.tsx b/src/screens/NoticesScreen.tsx index 76c9085e..c5d5d294 100644 --- a/src/screens/NoticesScreen.tsx +++ b/src/screens/NoticesScreen.tsx @@ -1,8 +1,7 @@ import * as Haptics from 'expo-haptics'; import {FuseOptions} from 'fuse.js'; import React, {useEffect} from 'react'; -import {Platform, RefreshControl, SafeAreaView} from 'react-native'; -import {FlatList} from 'react-native-gesture-handler'; +import {Platform, RefreshControl, SafeAreaView, FlatList} from 'react-native'; import {Navigation} from 'react-native-navigation'; import {Provider as PaperProvider, Searchbar} from 'react-native-paper'; import {connect} from 'react-redux';