diff --git a/package.json b/package.json index cc06e3ce..c1ebc338 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "matcher": "^0.1.2", "memoizee": "0.4.1", "promise-worker": "^1.1.1", + "prop-types": "^15.5.10", "react": "^15.4.0", "react-addons-perf": "0.14.8", "react-addons-shallow-compare": "0.14.8", diff --git a/src/core/components/app.jsx b/src/core/components/app.jsx index 3ed94b74..9ef5a8fd 100644 --- a/src/core/components/app.jsx +++ b/src/core/components/app.jsx @@ -1,4 +1,5 @@ -import React, { PropTypes } from "react" +import React from "react" +import PropTypes from "prop-types" export default class App extends React.Component { @@ -6,7 +7,7 @@ export default class App extends React.Component { let { getComponent, layoutSelectors } = this.props const layoutName = layoutSelectors.current() const Component = getComponent(layoutName, true) - return Component ? Component : ()=>
{ value }
+ return { value }
}
}
diff --git a/src/core/components/info.jsx b/src/core/components/info.jsx
index da53be06..6ea1ed48 100644
--- a/src/core/components/info.jsx
+++ b/src/core/components/info.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import { fromJS } from "immutable"
import ImPropTypes from "react-immutable-proptypes"
diff --git a/src/core/components/layout-utils.jsx b/src/core/components/layout-utils.jsx
index 22cd1d51..00a4a09d 100644
--- a/src/core/components/layout-utils.jsx
+++ b/src/core/components/layout-utils.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import OriCollapse from "react-collapse"
function xclass(...args) {
diff --git a/src/core/components/layouts/base.jsx b/src/core/components/layouts/base.jsx
index 35cfd7b8..9da4b347 100644
--- a/src/core/components/layouts/base.jsx
+++ b/src/core/components/layouts/base.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class BaseLayout extends React.Component {
diff --git a/src/core/components/layouts/xpane.jsx b/src/core/components/layouts/xpane.jsx
index b18af4a8..1149fc55 100644
--- a/src/core/components/layouts/xpane.jsx
+++ b/src/core/components/layouts/xpane.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class XPane extends React.Component {
diff --git a/src/core/components/live-response.jsx b/src/core/components/live-response.jsx
index 550208fa..bb61e252 100644
--- a/src/core/components/live-response.jsx
+++ b/src/core/components/live-response.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes"
const Headers = ( { headers } )=>{
diff --git a/src/core/components/model-example.jsx b/src/core/components/model-example.jsx
index 0117c9a5..1b4273ce 100644
--- a/src/core/components/model-example.jsx
+++ b/src/core/components/model-example.jsx
@@ -1,5 +1,5 @@
-import React, { PropTypes } from "react"
-
+import React from "react"
+import PropTypes from "prop-types"
export default class ModelExample extends React.Component {
static propTypes = {
diff --git a/src/core/components/model.jsx b/src/core/components/model.jsx
index a043c325..f2b2e99d 100644
--- a/src/core/components/model.jsx
+++ b/src/core/components/model.jsx
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from "react"
+import React, { Component } from "react"
+import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes"
import { List } from "immutable"
const braceOpen = "{"
diff --git a/src/core/components/models.jsx b/src/core/components/models.jsx
index 21605199..dbd14a05 100644
--- a/src/core/components/models.jsx
+++ b/src/core/components/models.jsx
@@ -1,5 +1,5 @@
-import React, { Component, PropTypes } from "react"
-
+import React, { Component } from "react"
+import PropTypes from "prop-types"
export default class Models extends Component {
static propTypes = {
diff --git a/src/core/components/online-validator-badge.jsx b/src/core/components/online-validator-badge.jsx
index 7988ea98..466d4c97 100644
--- a/src/core/components/online-validator-badge.jsx
+++ b/src/core/components/online-validator-badge.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class OnlineValidatorBadge extends React.Component {
static propTypes = {
diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx
index 31f52cda..50552ddc 100644
--- a/src/core/components/operation.jsx
+++ b/src/core/components/operation.jsx
@@ -1,4 +1,5 @@
-import React, { PureComponent, PropTypes } from "react"
+import React, { PureComponent } from "react"
+import PropTypes from "prop-types"
import { getList } from "core/utils"
import * as CustomPropTypes from "core/proptypes"
diff --git a/src/core/components/operations.jsx b/src/core/components/operations.jsx
index 16c8a86e..7275eea2 100644
--- a/src/core/components/operations.jsx
+++ b/src/core/components/operations.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class Operations extends React.Component {
diff --git a/src/core/components/overview.jsx b/src/core/components/overview.jsx
index 327c0135..6e1708d3 100644
--- a/src/core/components/overview.jsx
+++ b/src/core/components/overview.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import { Link } from "core/components/layout-utils"
export default class Overview extends React.Component {
diff --git a/src/core/components/param-body.jsx b/src/core/components/param-body.jsx
index ce5438d1..7de6766b 100644
--- a/src/core/components/param-body.jsx
+++ b/src/core/components/param-body.jsx
@@ -1,4 +1,5 @@
-import React, { PureComponent, PropTypes } from "react"
+import React, { PureComponent } from "react"
+import PropTypes from "prop-types"
import { fromJS, List } from "immutable"
import { getSampleSchema } from "core/utils"
diff --git a/src/core/components/parameter-row.jsx b/src/core/components/parameter-row.jsx
index 672e7c95..8db1f29a 100644
--- a/src/core/components/parameter-row.jsx
+++ b/src/core/components/parameter-row.jsx
@@ -1,7 +1,7 @@
-import React, { Component, PropTypes } from "react"
+import React, { Component } from "react"
+import PropTypes from "prop-types"
import win from "core/window"
-
export default class ParameterRow extends Component {
static propTypes = {
onChange: PropTypes.func.isRequired,
diff --git a/src/core/components/parameters.jsx b/src/core/components/parameters.jsx
index a1659849..b85cc8ab 100644
--- a/src/core/components/parameters.jsx
+++ b/src/core/components/parameters.jsx
@@ -1,4 +1,5 @@
-import React, { Component, PropTypes } from "react"
+import React, { Component } from "react"
+import PropTypes from "prop-types"
import ImPropTypes from "react-immutable-proptypes"
import Im from "immutable"
diff --git a/src/core/components/providers/markdown.jsx b/src/core/components/providers/markdown.jsx
index 8ebce12c..ff29f021 100644
--- a/src/core/components/providers/markdown.jsx
+++ b/src/core/components/providers/markdown.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import Remarkable from "react-remarkable"
import sanitize from "sanitize-html"
diff --git a/src/core/components/response-body.jsx b/src/core/components/response-body.jsx
index 45f8e90c..b933eb70 100644
--- a/src/core/components/response-body.jsx
+++ b/src/core/components/response-body.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import { formatXml } from "core/utils"
import lowerCase from "lodash/lowerCase"
diff --git a/src/core/components/response.jsx b/src/core/components/response.jsx
index 227ce43a..b63c8d7b 100644
--- a/src/core/components/response.jsx
+++ b/src/core/components/response.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import { fromJS } from "immutable"
import { getSampleSchema } from "core/utils"
diff --git a/src/core/components/responses.jsx b/src/core/components/responses.jsx
index 8bbe4f0f..f32e7a1f 100644
--- a/src/core/components/responses.jsx
+++ b/src/core/components/responses.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import { fromJS } from "immutable"
import { defaultStatusCode } from "core/utils"
diff --git a/src/core/components/schemes.jsx b/src/core/components/schemes.jsx
index 21d954f0..4742e691 100644
--- a/src/core/components/schemes.jsx
+++ b/src/core/components/schemes.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class Schemes extends React.Component {
diff --git a/src/core/components/try-it-out-button.jsx b/src/core/components/try-it-out-button.jsx
index aa2b4da2..e2b66294 100644
--- a/src/core/components/try-it-out-button.jsx
+++ b/src/core/components/try-it-out-button.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
export default class TryItOutButton extends React.Component {
diff --git a/src/core/json-schema-components.js b/src/core/json-schema-components.js
index b7795f15..bf4ae514 100644
--- a/src/core/json-schema-components.js
+++ b/src/core/json-schema-components.js
@@ -1,4 +1,5 @@
-import React, { PropTypes, PureComponent, Component } from "react"
+import React, { PureComponent, Component } from "react"
+import PropTypes from "prop-types"
import { List, fromJS } from "immutable"
//import "less/json-schema-form"
diff --git a/src/core/plugins/split-pane-mode/components/split-pane-mode.jsx b/src/core/plugins/split-pane-mode/components/split-pane-mode.jsx
index 74190445..73f2acbc 100644
--- a/src/core/plugins/split-pane-mode/components/split-pane-mode.jsx
+++ b/src/core/plugins/split-pane-mode/components/split-pane-mode.jsx
@@ -1,4 +1,5 @@
-import React, { PropTypes } from "react"
+import React from "react"
+import PropTypes from "prop-types"
import SplitPane from "react-split-pane"
import "./split-pane-mode.less"
@@ -23,9 +24,13 @@ export default class SplitPaneMode extends React.Component {
children: [],
};
+ initializeComponent = (c) => {
+ this.splitPane = c
+ }
+
onDragFinished = () => {
let { threshold, layoutActions } = this.props
- let { position, draggedSize } = this.refs.splitPane.state
+ let { position, draggedSize } = this.splitPane.state
this.draggedSize = draggedSize
let nearLeftEdge = position <= threshold
@@ -62,7 +67,7 @@ export default class SplitPaneMode extends React.Component {
return (