chore: do not use React.PropTypes directly

This commit is contained in:
Julien Fontanet 2017-12-18 16:58:22 +01:00
parent be9eb8ce91
commit ecc086f15d
10 changed files with 17 additions and 8 deletions

View File

@ -107,6 +107,7 @@
"notifyjs": "^3.0.0", "notifyjs": "^3.0.0",
"prettier": "^1.9.2", "prettier": "^1.9.2",
"promise-toolbox": "^0.9.5", "promise-toolbox": "^0.9.5",
"prop-types": "^15.6.0",
"random-password": "^0.1.2", "random-password": "^0.1.2",
"react": "^15.4.1", "react": "^15.4.1",
"react-addons-shallow-compare": "^15.6.2", "react-addons-shallow-compare": "^15.6.2",

View File

@ -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' import { isPromise } from 'promise-toolbox'
const toString = value => const toString = value =>

View File

@ -1,7 +1,8 @@
import isFunction from 'lodash/isFunction' import isFunction from 'lodash/isFunction'
import isString from 'lodash/isString' import isString from 'lodash/isString'
import moment from 'moment' 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 { connect } from 'react-redux'
import { FormattedMessage, IntlProvider as IntlProvider_ } from 'react-intl' import { FormattedMessage, IntlProvider as IntlProvider_ } from 'react-intl'

View File

@ -1,5 +1,5 @@
import assign from 'lodash/assign' import assign from 'lodash/assign'
import { PropTypes } from 'react' import PropTypes from 'prop-types'
// Decorators to help declaring properties and context types on React // Decorators to help declaring properties and context types on React
// components without using the tedious static properties syntax. // components without using the tedious static properties syntax.

View File

@ -1,6 +1,7 @@
import _ from 'intl' import _ from 'intl'
import classNames from 'classnames' 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 sum from 'lodash/sum'
import Tooltip from '../tooltip' import Tooltip from '../tooltip'

View File

@ -4,6 +4,7 @@ import DocumentTitle from 'react-document-title'
import Icon from 'icon' import Icon from 'icon'
import isArray from 'lodash/isArray' import isArray from 'lodash/isArray'
import map from 'lodash/map' import map from 'lodash/map'
import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import Shortcuts from 'shortcuts' import Shortcuts from 'shortcuts'
import themes from 'themes' import themes from 'themes'
@ -97,10 +98,10 @@ const BODY_STYLE = {
}) })
export default class XoApp extends Component { export default class XoApp extends Component {
static contextTypes = { static contextTypes = {
router: React.PropTypes.object, router: PropTypes.object,
} }
static childContextTypes = { static childContextTypes = {
shortcuts: React.PropTypes.object.isRequired, shortcuts: PropTypes.object.isRequired,
} }
getChildContext = () => ({ shortcuts: shortcutManager }) getChildContext = () => ({ shortcuts: shortcutManager })

View File

@ -7,6 +7,7 @@ import defined, { get } from 'xo-defined'
import Icon from 'icon' import Icon from 'icon'
import isIp from 'is-ip' import isIp from 'is-ip'
import Page from '../page' import Page from '../page'
import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import store from 'store' import store from 'store'
import Tags from 'tags' import Tags from 'tags'
@ -210,7 +211,7 @@ class Vif extends BaseComponent {
@injectIntl @injectIntl
export default class NewVm extends BaseComponent { export default class NewVm extends BaseComponent {
static contextTypes = { static contextTypes = {
router: React.PropTypes.object, router: PropTypes.object,
} }
constructor () { constructor () {

View File

@ -1,5 +1,6 @@
import { messages } from 'intl' import { messages } from 'intl'
import DocumentTitle from 'react-document-title' import DocumentTitle from 'react-document-title'
import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import { injectIntl } from 'react-intl' import { injectIntl } from 'react-intl'

View File

@ -3,6 +3,7 @@ import Component from 'base-component'
import Icon from 'icon' import Icon from 'icon'
import Link from 'link' import Link from 'link'
import Page from '../page' import Page from '../page'
import PropTypes from 'prop-types'
import React, { cloneElement } from 'react' import React, { cloneElement } from 'react'
import SrActionBar from './action-bar' import SrActionBar from './action-bar'
import { Container, Row, Col } from 'grid' import { Container, Row, Col } from 'grid'
@ -90,7 +91,7 @@ import TabXosan from './tab-xosan'
}) })
export default class Sr extends Component { export default class Sr extends Component {
static contextTypes = { static contextTypes = {
router: React.PropTypes.object, router: PropTypes.object,
} }
componentWillReceiveProps (props) { componentWillReceiveProps (props) {

View File

@ -4,6 +4,7 @@ import Icon from 'icon'
import Link from 'link' import Link from 'link'
import { NavLink, NavTabs } from 'nav' import { NavLink, NavTabs } from 'nav'
import Page from '../page' import Page from '../page'
import PropTypes from 'prop-types'
import React, { cloneElement } from 'react' import React, { cloneElement } from 'react'
import VmActionBar from './action-bar' import VmActionBar from './action-bar'
import { Select, Text } from 'editable' import { Select, Text } from 'editable'