diff --git a/package.json b/package.json index 401a4058f..9f1d75e66 100644 --- a/package.json +++ b/package.json @@ -107,6 +107,7 @@ "notifyjs": "^3.0.0", "prettier": "^1.9.2", "promise-toolbox": "^0.9.5", + "prop-types": "^15.6.0", "random-password": "^0.1.2", "react": "^15.4.1", "react-addons-shallow-compare": "^15.6.2", diff --git a/src/common/debug.js b/src/common/debug.js index 218a320a5..58800131d 100644 --- a/src/common/debug.js +++ b/src/common/debug.js @@ -1,4 +1,5 @@ -import React, { Component, PropTypes } from 'react' +import PropTypes from 'prop-types' +import React, { Component } from 'react' import { isPromise } from 'promise-toolbox' const toString = value => diff --git a/src/common/intl/index.js b/src/common/intl/index.js index 9b67001fd..15f76ea58 100644 --- a/src/common/intl/index.js +++ b/src/common/intl/index.js @@ -1,7 +1,8 @@ import isFunction from 'lodash/isFunction' import isString from 'lodash/isString' import moment from 'moment' -import React, { Component, PropTypes } from 'react' +import PropTypes from 'prop-types' +import React, { Component } from 'react' import { connect } from 'react-redux' import { FormattedMessage, IntlProvider as IntlProvider_ } from 'react-intl' diff --git a/src/common/prop-types-decorator.js b/src/common/prop-types-decorator.js index 65421f59e..eb5224473 100644 --- a/src/common/prop-types-decorator.js +++ b/src/common/prop-types-decorator.js @@ -1,5 +1,5 @@ import assign from 'lodash/assign' -import { PropTypes } from 'react' +import PropTypes from 'prop-types' // Decorators to help declaring properties and context types on React // components without using the tedious static properties syntax. diff --git a/src/common/usage/index.js b/src/common/usage/index.js index c3bfc8a2e..5e7788884 100644 --- a/src/common/usage/index.js +++ b/src/common/usage/index.js @@ -1,6 +1,7 @@ import _ from 'intl' import classNames from 'classnames' -import React, { PropTypes, cloneElement } from 'react' +import PropTypes from 'prop-types' +import React, { cloneElement } from 'react' import sum from 'lodash/sum' import Tooltip from '../tooltip' diff --git a/src/xo-app/index.js b/src/xo-app/index.js index 4b7cba57f..da55ab7d4 100644 --- a/src/xo-app/index.js +++ b/src/xo-app/index.js @@ -4,6 +4,7 @@ import DocumentTitle from 'react-document-title' import Icon from 'icon' import isArray from 'lodash/isArray' import map from 'lodash/map' +import PropTypes from 'prop-types' import React from 'react' import Shortcuts from 'shortcuts' import themes from 'themes' @@ -97,10 +98,10 @@ const BODY_STYLE = { }) export default class XoApp extends Component { static contextTypes = { - router: React.PropTypes.object, + router: PropTypes.object, } static childContextTypes = { - shortcuts: React.PropTypes.object.isRequired, + shortcuts: PropTypes.object.isRequired, } getChildContext = () => ({ shortcuts: shortcutManager }) diff --git a/src/xo-app/new-vm/index.js b/src/xo-app/new-vm/index.js index ef098d07a..77a3353a7 100644 --- a/src/xo-app/new-vm/index.js +++ b/src/xo-app/new-vm/index.js @@ -7,6 +7,7 @@ import defined, { get } from 'xo-defined' import Icon from 'icon' import isIp from 'is-ip' import Page from '../page' +import PropTypes from 'prop-types' import React from 'react' import store from 'store' import Tags from 'tags' @@ -210,7 +211,7 @@ class Vif extends BaseComponent { @injectIntl export default class NewVm extends BaseComponent { static contextTypes = { - router: React.PropTypes.object, + router: PropTypes.object, } constructor () { diff --git a/src/xo-app/page/index.js b/src/xo-app/page/index.js index 44c98226d..45c5852d0 100644 --- a/src/xo-app/page/index.js +++ b/src/xo-app/page/index.js @@ -1,5 +1,6 @@ import { messages } from 'intl' import DocumentTitle from 'react-document-title' +import PropTypes from 'prop-types' import React from 'react' import { injectIntl } from 'react-intl' diff --git a/src/xo-app/sr/index.js b/src/xo-app/sr/index.js index 82fb4f53d..dc468c1f3 100644 --- a/src/xo-app/sr/index.js +++ b/src/xo-app/sr/index.js @@ -3,6 +3,7 @@ import Component from 'base-component' import Icon from 'icon' import Link from 'link' import Page from '../page' +import PropTypes from 'prop-types' import React, { cloneElement } from 'react' import SrActionBar from './action-bar' import { Container, Row, Col } from 'grid' @@ -90,7 +91,7 @@ import TabXosan from './tab-xosan' }) export default class Sr extends Component { static contextTypes = { - router: React.PropTypes.object, + router: PropTypes.object, } componentWillReceiveProps (props) { diff --git a/src/xo-app/vm/index.js b/src/xo-app/vm/index.js index 543f24cf6..fb7138855 100644 --- a/src/xo-app/vm/index.js +++ b/src/xo-app/vm/index.js @@ -4,6 +4,7 @@ import Icon from 'icon' import Link from 'link' import { NavLink, NavTabs } from 'nav' import Page from '../page' +import PropTypes from 'prop-types' import React, { cloneElement } from 'react' import VmActionBar from './action-bar' import { Select, Text } from 'editable'