Remove PropTypes from ElementProperties (#21350)

Summary:
Related to #21342
Pull Request resolved: https://github.com/facebook/react-native/pull/21350

Differential Revision: D10081454

Pulled By: TheSavior

fbshipit-source-id: db27a1f23c643b7d6d73136254eff91625419583
This commit is contained in:
kdastan
2018-09-26 22:35:13 -07:00
committed by Facebook Github Bot
parent f3c8027595
commit c650407fe9
+9 -18
View File
@@ -11,7 +11,6 @@
'use strict';
const BoxInspector = require('BoxInspector');
const PropTypes = require('prop-types');
const React = require('React');
const StyleInspector = require('StyleInspector');
const StyleSheet = require('StyleSheet');
@@ -24,29 +23,21 @@ const flattenStyle = require('flattenStyle');
const mapWithSeparator = require('mapWithSeparator');
const openFileInEditor = require('openFileInEditor');
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';
import type {ViewStyleProp} from 'StyleSheet';
class ElementProperties extends React.Component<{
type Props = $ReadOnly<{|
hierarchy: Array<$FlowFixMe>,
style?: DangerouslyImpreciseStyleProp,
source?: {
style?: ?ViewStyleProp,
source?: ?{
fileName?: string,
lineNumber?: number,
},
}> {
static propTypes = {
hierarchy: PropTypes.array.isRequired,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.array,
PropTypes.number,
]),
source: PropTypes.shape({
fileName: PropTypes.string,
lineNumber: PropTypes.number,
}),
};
frame?: ?Object,
selection?: ?number,
setSelection?: (number) => mixed,
|}>;
class ElementProperties extends React.Component<Props> {
render() {
const style = flattenStyle(this.props.style);
// $FlowFixMe found when converting React.createClass to ES6