Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 3d8545d

Browse files
committed
Merge pull request #170 from kassens/flow
Fix some $FlowFixMe by subclassing React.Component
2 parents b94a3ce + a1b5d53 commit 3d8545d

File tree

7 files changed

+4
-12
lines changed

7 files changed

+4
-12
lines changed

frontend/DataView/DataView.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Simple = require('./Simple');
1616
var consts = require('../../agent/consts');
1717
var previewComplex = require('./previewComplex');
1818

19-
class DataView {
19+
class DataView extends React.Component {
2020
props: {
2121
data: Object,
2222
path: Array<string>,
@@ -136,7 +136,6 @@ class DataItem extends React.Component {
136136
// TODO path
137137
children = (
138138
<div style={styles.children}>
139-
{/* $FlowFixMe flow thinks DataView must subclass React.Component */}
140139
<DataView
141140
data={this.props.value}
142141
path={this.props.path}

frontend/Draggable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var React = require('react');
1414
import type {DOMEvent} from './types';
1515

16-
class Draggable {
16+
class Draggable extends React.Component {
1717
_onMove: (evt: DOMEvent) => void;
1818
_onUp: (evt: DOMEvent) => void;
1919
props: {

frontend/Node.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class Node {
134134
<span style={styles.tagText}>
135135
<span style={styles.openTag}>
136136
<span style={tagStyle}>&lt;{name}</span>
137-
{/* $FlowFixMe doesn't need to inherit from React.Component */}
138137
{node.get('props') && <Props props={node.get('props')}/>}
139138
{!content && '/'}
140139
<span style={tagStyle}>&gt;</span>
@@ -187,7 +186,6 @@ class Node {
187186
<span style={styles.tagText}>
188187
<span style={styles.openTag}>
189188
<span style={tagStyle}>&lt;{'' + node.get('name')}</span>
190-
{/* $FlowFixMe doesn't need to inherit from React.Component */}
191189
{node.get('props') && <Props props={node.get('props')}/>}
192190
<span style={tagStyle}>&gt;</span>
193191
</span>

frontend/PropState.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ class PropState extends React.Component {
8181
<div style={styles.section}>
8282
<strong>Props</strong>
8383
{propsReadOnly && <em> read-only</em>}
84-
{/* $FlowFixMe flow thinks DataView must subclass React.Component */}
8584
<DataView
8685
path={['props']}
8786
readOnly={propsReadOnly}
@@ -94,7 +93,6 @@ class PropState extends React.Component {
9493
{state &&
9594
<div style={styles.section}>
9695
<strong>State</strong>
97-
{/* $FlowFixMe flow thinks DataView must subclass React.Component */}
9896
<DataView
9997
data={state}
10098
path={['state']}
@@ -106,7 +104,6 @@ class PropState extends React.Component {
106104
{context &&
107105
<div style={styles.section}>
108106
<strong>Context</strong>
109-
{/* $FlowFixMe flow thinks DataView must subclass React.Component */}
110107
<DataView
111108
data={context}
112109
path={['context']}

frontend/Props.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
var React = require('react');
1414
var PropVal = require('./PropVal');
1515

16-
class Props {
16+
class Props extends React.Component {
1717
props: Object;
1818
shouldComponentUpdate(nextProps: Object): boolean {
1919
if (nextProps === this.props) {

frontend/SplitPane.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class SplitPane extends React.Component {
4141
<div style={styles.leftPane}>
4242
{this.props.left()}
4343
</div>
44-
{/* $FlowFixMe the "extends React.Component" is just to help flow */}
4544
<Draggable
4645
style={dragStyle}
4746
onStart={() => this.setState({moving: true})}

plugins/DepGraph/DepGraph.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ class DisplayDeps {
4545
return (
4646
<div style={styles.container}>
4747
<div style={styles.scrollParent}>
48-
{/* $FlowFixMe doesn't need to inherit from React.Component */}
4948
<SvgGraph
5049
onHover={this.props.onHover}
5150
onClick={this.props.onClick}
@@ -61,7 +60,7 @@ class DisplayDeps {
6160
}
6261
}
6362

64-
class SvgGraph {
63+
class SvgGraph extends React.Component {
6564
props: Object;
6665
render() {
6766
var graph = this.props.graph;

0 commit comments

Comments
 (0)