Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove PropTypes from ElementProperties #21350

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions Libraries/Inspector/ElementProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -24,29 +23,21 @@ const flattenStyle = require('flattenStyle');
const mapWithSeparator = require('mapWithSeparator');
const openFileInEditor = require('openFileInEditor');

import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier/prettier: Replace (number) with number

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
Expand Down