Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removed disableIntervalMomentum animated value that cause crash on RN63 #13

Merged
merged 1 commit into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/bottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
/**
* Scrollable animated props.
*/
const disableIntervalMomentum = greaterThan(position, 0);
const decelerationRate = cond(greaterThan(position, 0), 0.001, 0.999);
//#endregion

Expand Down Expand Up @@ -299,7 +298,6 @@ const BottomSheetComponent = forwardRef<BottomSheet, BottomSheetProps>(
contentPanGestureTranslationY,
contentPanGestureVelocityY,
scrollableContentOffsetY,
disableIntervalMomentum,
decelerationRate,
setScrollableRef: handleSettingScrollableRef,
removeScrollableRef,
Expand Down
8 changes: 1 addition & 7 deletions src/components/flatList/FlatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ const BottomSheetFlatListComponent = forwardRef(
handleScrollEvent,
handleSettingScrollable,
} = useScrollableInternal('FlatList');
const {
rootTapGestureRef,
disableIntervalMomentum,
decelerationRate,
} = useBottomSheetInternal();
const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal();

// effects
// @ts-ignore
Expand All @@ -70,8 +66,6 @@ const BottomSheetFlatListComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
8 changes: 1 addition & 7 deletions src/components/scrollView/ScrollView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ const BottomSheetScrollViewComponent = forwardRef(
handleScrollEvent,
handleSettingScrollable,
} = useScrollableInternal('ScrollView');
const {
rootTapGestureRef,
disableIntervalMomentum,
decelerationRate,
} = useBottomSheetInternal();
const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal();

// effects
// @ts-ignore
Expand All @@ -73,8 +69,6 @@ const BottomSheetScrollViewComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
8 changes: 1 addition & 7 deletions src/components/sectionList/SectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ const BottomSheetSectionListComponent = forwardRef(
handleScrollEvent,
handleSettingScrollable,
} = useScrollableInternal('SectionList');
const {
rootTapGestureRef,
disableIntervalMomentum,
decelerationRate,
} = useBottomSheetInternal();
const { rootTapGestureRef, decelerationRate } = useBottomSheetInternal();
// effects
// @ts-ignore
useImperativeHandle(ref, () => scrollableRef.current!.getNode());
Expand All @@ -69,8 +65,6 @@ const BottomSheetSectionListComponent = forwardRef(
ref={scrollableRef}
overScrollMode="never"
bounces={false}
// @ts-ignore
disableIntervalMomentum={disableIntervalMomentum}
decelerationRate={decelerationRate}
scrollEventThrottle={1}
onScrollBeginDrag={handleScrollEvent}
Expand Down
1 change: 0 additions & 1 deletion src/contexts/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export type BottomSheetInternalContextType = {
contentPanGestureTranslationY: Animated.Value<number>;
contentPanGestureVelocityY: Animated.Value<number>;
scrollableContentOffsetY: Animated.Value<number>;
disableIntervalMomentum: Animated.Node<number>;
decelerationRate: Animated.Node<number>;
setScrollableRef: (ref: ScrollableRef) => void;
removeScrollableRef: (ref: RefObject<Scrollable>) => void;
Expand Down