From d1d23a6e0f124fa72c1f897550adb86bcef583f1 Mon Sep 17 00:00:00 2001 From: Julio Xavier Date: Thu, 27 Sep 2018 10:42:17 -0700 Subject: [PATCH] Remove PropTypes from IncrementalPresenter (#21343) Summary: Related to https://github.com/facebook/react-native/issues/21342 Pull Request resolved: https://github.com/facebook/react-native/pull/21343 Reviewed By: RSNara Differential Revision: D10080219 Pulled By: TheSavior fbshipit-source-id: 3a9108208fe6aaa7a30b99f24ceef03e884ec48a --- Libraries/Components/View/ViewPropTypes.js | 2 +- .../Experimental/IncrementalPresenter.js | 20 +++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index ea854ddcea26f3..65b37fc6a791e2 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -53,7 +53,7 @@ type DirectEventProps = $ReadOnly<{| * * See http://facebook.github.io/react-native/docs/view.html#onlayout */ - onLayout?: ?(event: LayoutEvent) => void, + onLayout?: ?(event: LayoutEvent) => mixed, /** * When `accessible` is `true`, the system will invoke this function when the diff --git a/Libraries/Experimental/IncrementalPresenter.js b/Libraries/Experimental/IncrementalPresenter.js index 6972887fd9bdb8..742d0e93443f24 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'); @@ -18,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 @@ -31,25 +31,19 @@ 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; - 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,