From 6a00a5deabe58e396b5842d1d83f4d7ae01d5b8e Mon Sep 17 00:00:00 2001 From: Arthur Kushka Date: Wed, 29 Jan 2020 12:46:36 -0800 Subject: [PATCH] Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android Summary: In case when Platform is different from Android or iOS, ScrollView initialised RCTScrollView two times, which caused a crash. It looks for me that default option is obsolete and can be united with iOS one to fix this issue. ## Changelog: [Internal] [Fixed] - Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android Reviewed By: ejanzer Differential Revision: D19623046 fbshipit-source-id: 84f8a46ea24b463aa6aae761f4386ab7e4e95f9b --- Libraries/Components/ScrollView/ScrollView.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Libraries/Components/ScrollView/ScrollView.js b/Libraries/Components/ScrollView/ScrollView.js index 184863d4761..db866e1f7fb 100644 --- a/Libraries/Components/ScrollView/ScrollView.js +++ b/Libraries/Components/ScrollView/ScrollView.js @@ -24,7 +24,6 @@ const dismissKeyboard = require('../../Utilities/dismissKeyboard'); const flattenStyle = require('../../StyleSheet/flattenStyle'); const invariant = require('invariant'); const processDecelerationRate = require('./processDecelerationRate'); -const requireNativeComponent = require('../../ReactNative/requireNativeComponent'); const resolveAssetSource = require('../../Image/resolveAssetSource'); const splitLayoutProps = require('../../StyleSheet/splitLayoutProps'); @@ -57,12 +56,9 @@ if (Platform.OS === 'android') { AndroidScrollView = ScrollViewNativeComponent; AndroidHorizontalScrollView = AndroidHorizontalScrollViewNativeComponent; AndroidHorizontalScrollContentView = AndroidHorizontalScrollContentViewNativeComponent; -} else if (Platform.OS === 'ios') { +} else { RCTScrollView = ScrollViewNativeComponent; RCTScrollContentView = ScrollContentViewNativeComponent; -} else { - RCTScrollView = requireNativeComponent('RCTScrollView'); - RCTScrollContentView = requireNativeComponent('RCTScrollContentView'); } export type ScrollResponderType = {