From b8c7ba5079302ee24e9cc44bbb16199394e11975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlio=20Xavier?= Date: Wed, 26 Sep 2018 21:58:08 -0300 Subject: [PATCH 1/3] Remove PropTypes from IncrementalPresenter Related to https://github.com/facebook/react-native/issues/21342 --- Libraries/Experimental/IncrementalPresenter.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Libraries/Experimental/IncrementalPresenter.js b/Libraries/Experimental/IncrementalPresenter.js index 6972887fd9bdb8..08dae227428d76 100644 --- a/Libraries/Experimental/IncrementalPresenter.js +++ b/Libraries/Experimental/IncrementalPresenter.js @@ -10,7 +10,6 @@ 'use strict'; -const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes'); const IncrementalGroup = require('IncrementalGroup'); const PropTypes = require('prop-types'); const React = require('React'); @@ -43,13 +42,6 @@ class IncrementalPresenter extends React.Component { context: Context; _isDone: boolean; - static propTypes = { - name: PropTypes.string, - disabled: PropTypes.bool, - onDone: PropTypes.func, - onLayout: PropTypes.func, - style: DeprecatedViewPropTypes.style, - }; static contextTypes = { incrementalGroup: PropTypes.object, incrementalGroupEnabled: PropTypes.bool, From ea9dbbc5bf93cda5d21ad0a983af48e0c8615a2b Mon Sep 17 00:00:00 2001 From: Julio Xavier Date: Wed, 26 Sep 2018 22:43:24 -0300 Subject: [PATCH 2/3] Update Flow props for IncrementalPresenter --- Libraries/Experimental/IncrementalPresenter.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Libraries/Experimental/IncrementalPresenter.js b/Libraries/Experimental/IncrementalPresenter.js index 08dae227428d76..742d0e93443f24 100644 --- a/Libraries/Experimental/IncrementalPresenter.js +++ b/Libraries/Experimental/IncrementalPresenter.js @@ -17,6 +17,7 @@ const View = require('View'); import type {Context} from 'Incremental'; import type {ViewStyleProp} from 'StyleSheet'; +import type {LayoutEvent} from 'CoreEventTypes'; /** * WARNING: EXPERIMENTAL. Breaking changes will probably happen a lot and will @@ -30,14 +31,15 @@ import type {ViewStyleProp} from 'StyleSheet'; * * See Incremental.js for more info. */ -type Props = { +type Props = $ReadOnly<{| name: string, disabled?: boolean, - onDone?: () => void, - onLayout?: (event: Object) => void, + onDone?: () => mixed, + onLayout?: (event: LayoutEvent) => mixed, style?: ViewStyleProp, - children?: any, -}; + children?: React.Node, +|}>; + class IncrementalPresenter extends React.Component { context: Context; _isDone: boolean; From d6de15951c24f43d160afc3b713507e37f4527e1 Mon Sep 17 00:00:00 2001 From: Julio Xavier Date: Wed, 26 Sep 2018 22:57:14 -0300 Subject: [PATCH 3/3] Update ViewPropTypes onLayout callback --- Libraries/Components/View/ViewPropTypes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index f2e6f4cba737ba..a083abef1a212f 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -28,7 +28,7 @@ export type ViewLayoutEvent = LayoutEvent; type DirectEventProps = $ReadOnly<{| onAccessibilityAction?: ?Function, onAccessibilityTap?: ?Function, - onLayout?: ?(event: LayoutEvent) => void, + onLayout?: ?(event: LayoutEvent) => mixed, onMagicTap?: ?Function, |}>;