From dd3bf0545abf48f5abc471049e2ce2073ade1cd9 Mon Sep 17 00:00:00 2001 From: Eli White Date: Fri, 11 Oct 2019 09:44:48 -0700 Subject: [PATCH] Change ScrollView event flow types to support spreading Summary: These need to be both optional and nullable to support spreading props like `` where these types are optional in a parent component. Reviewed By: lunaleaps Differential Revision: D17859633 fbshipit-source-id: 093456d13ee041473a4605e62bf48b3510b49b8f --- Libraries/Components/ScrollView/ScrollView.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 121772fa7b9..fa3daffabaf 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -460,26 +460,26 @@ export type Props = $ReadOnly<{| /** * Called when the momentum scroll starts (scroll which occurs as the ScrollView glides to a stop). */ - onMomentumScrollBegin?: (event: ScrollEvent) => void, + onMomentumScrollBegin?: ?(event: ScrollEvent) => void, /** * Called when the momentum scroll ends (scroll which occurs as the ScrollView glides to a stop). */ - onMomentumScrollEnd?: (event: ScrollEvent) => void, + onMomentumScrollEnd?: ?(event: ScrollEvent) => void, /** * Fires at most once per frame during scrolling. The frequency of the * events can be controlled using the `scrollEventThrottle` prop. */ - onScroll?: (event: ScrollEvent) => void, + onScroll?: ?(event: ScrollEvent) => void, /** * Called when the user begins to drag the scroll view. */ - onScrollBeginDrag?: (event: ScrollEvent) => void, + onScrollBeginDrag?: ?(event: ScrollEvent) => void, /** * Called when the user stops dragging the scroll view and it either stops * or begins to glide. */ - onScrollEndDrag?: (event: ScrollEvent) => void, + onScrollEndDrag?: ?(event: ScrollEvent) => void, /** * Called when scrollable content view of the ScrollView changes. *