Skip to content

Commit

Permalink
Make Flow types more strict
Browse files Browse the repository at this point in the history
Summary: Many of the optional types from the PR could have been made non-optional. I just made the change because it was simple enough to make and verify.

Reviewed By: TheSavior

Differential Revision: D10131969

fbshipit-source-id: b84693b5549708d7948fe3fd54295bc80be93790
  • Loading branch information
RSNara authored and facebook-github-bot committed Oct 1, 2018
1 parent c870533 commit 07ac31e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Libraries/Inspector/ElementProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const openFileInEditor = require('openFileInEditor');
import type {ViewStyleProp} from 'StyleSheet';

type Props = $ReadOnly<{|
hierarchy: Array<$FlowFixMe>,
hierarchy: Array<{|name: string|}>,
style?: ?ViewStyleProp,
source?: ?{
fileName?: string,
Expand Down
27 changes: 14 additions & 13 deletions Libraries/Inspector/InspectorPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,31 @@ const View = require('View');
import type {ViewStyleProp} from 'StyleSheet';

type Props = $ReadOnly<{|
devtoolsIsOpen?: ?boolean,
devtoolsIsOpen: boolean,
inspecting: boolean,
setInspecting: (val: boolean) => void,
perfing: boolean,
setPerfing: (val: boolean) => void,
touchTargeting?: ?boolean,
setTouchTargeting?: ?(val: boolean) => void,
networking?: ?boolean,
setNetworking?: ?(val: boolean) => void,
hierarchy?: any,
selection: number,
touchTargeting: boolean,
setTouchTargeting: (val: boolean) => void,
networking: boolean,
setNetworking: (val: boolean) => void,
hierarchy?: ?Array<{|name: string|}>,
selection?: ?number,
setSelection: number => mixed,
inspected?: ?{|
inspected?: ?$ReadOnly<{|
style?: ?ViewStyleProp,
frame?: ?{|
frame?: ?$ReadOnly<{|
top?: ?number,
left?: ?number,
width?: ?number,
height: ?number,
|},
|}>,
source?: ?{|
fileName?: string,
lineNumber?: number,
|},
|},
|}>,
|}>;

class InspectorPanel extends React.Component<Props> {
Expand All @@ -69,6 +69,7 @@ class InspectorPanel extends React.Component<Props> {
style={this.props.inspected.style}
frame={this.props.inspected.frame}
source={this.props.inspected.source}
// $FlowFixMe: Hierarchy should be non-nullable
hierarchy={this.props.hierarchy}
selection={this.props.selection}
setSelection={this.props.setSelection}
Expand Down Expand Up @@ -114,8 +115,8 @@ class InspectorPanel extends React.Component<Props> {

type InspectorPanelButtonProps = $ReadOnly<{|
onClick: (val: boolean) => void,
pressed?: ?boolean,
title?: ?string,
pressed: boolean,
title: string,
|}>;

class InspectorPanelButton extends React.Component<InspectorPanelButtonProps> {
Expand Down

0 comments on commit 07ac31e

Please sign in to comment.