Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Convert propTypes to Flow Props #2842

Merged
merged 2 commits into from
May 8, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 9 additions & 7 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,21 @@ const WelcomeBox = createFactory(_WelcomeBox);
import _EditorTabs from "./Editor/Tabs";
const EditorTabs = createFactory(_EditorTabs);

type Props = {
selectSource: Function,
selectedSource: Object,
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets use the Source or SourceRecord type here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jasonLaster Ok! :)

startPanelCollapsed: boolean,
endPanelCollapsed: boolean
};

class App extends Component {
state: {
horizontal: boolean,
startPanelSize: number,
endPanelSize: number
};

props: Props;
onLayoutChange: Function;
getChildContext: Function;
renderEditorPane: Function;
Expand Down Expand Up @@ -168,13 +177,6 @@ class App extends Component {
}
}

App.propTypes = {
selectSource: PropTypes.func,
selectedSource: PropTypes.object,
startPanelCollapsed: PropTypes.bool,
endPanelCollapsed: PropTypes.bool
};

App.displayName = "App";

App.childContextTypes = { shortcuts: PropTypes.object };
Expand Down
16 changes: 9 additions & 7 deletions src/components/WelcomeBox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import { DOM as dom, PropTypes, Component, createFactory } from "react";
import { DOM as dom, Component, createFactory } from "react";
import { connect } from "react-redux";
import { bindActionCreators } from "redux";

Expand All @@ -12,7 +12,15 @@ const PaneToggleButton = createFactory(_PaneToggleButton);

import "./WelcomeBox.css";

type Props = {
horizontal: boolean,
togglePaneCollapse: Function,
endPanelCollapsed: boolean
};

class WelcomeBox extends Component {
props: Props;

renderToggleButton() {
if (this.props.horizontal) {
return;
Expand All @@ -39,12 +47,6 @@ class WelcomeBox extends Component {
}
}

WelcomeBox.propTypes = {
horizontal: PropTypes.bool,
togglePaneCollapse: PropTypes.func,
endPanelCollapsed: PropTypes.bool
};

WelcomeBox.displayName = "WelcomeBox";

export default connect(
Expand Down