From 4185a45be40e014d5e6315c70de00fe5f76c726a Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 28 Jan 2020 04:12:55 -0800 Subject: [PATCH] Fix ScrollViewProps.snapToInterval type Summary: `SnapToInterval` is a Float in JavaScript, if we pass it and try to convert it to Int, it crashes in C++. exception > libc++abi.dylib: terminating with uncaught exception of type folly::ConversionError: Loss of precision during arithmetic conversion: (long long) 1.15 Changelog: [Internal] Reviewed By: shergin Differential Revision: D19580509 fbshipit-source-id: f705f92953195a9e034f6ce3fe7a077007d5212d --- ReactCommon/fabric/components/scrollview/ScrollViewProps.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/fabric/components/scrollview/ScrollViewProps.h b/ReactCommon/fabric/components/scrollview/ScrollViewProps.h index 506c0a12962..14e5c5a88bd 100644 --- a/ReactCommon/fabric/components/scrollview/ScrollViewProps.h +++ b/ReactCommon/fabric/components/scrollview/ScrollViewProps.h @@ -44,7 +44,7 @@ class ScrollViewProps final : public ViewProps { const Float zoomScale{1.0}; const EdgeInsets contentInset{}; const EdgeInsets scrollIndicatorInsets{}; - const int snapToInterval{}; + const Float snapToInterval{}; const ScrollViewSnapToAlignment snapToAlignment{}; #pragma mark - DebugStringConvertible