Use prop-types library to silence PropTypes deprecation warning (#2498)

* Use prop-types library to fix the deprecation warning.

* Updated weaveworks-ui-components version.
This commit is contained in:
Filip Barl
2017-05-05 18:23:43 +02:00
committed by GitHub
parent 5346a92a3e
commit 10b276c28a
4 changed files with 16 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
class CloudFeature extends React.Component {
@@ -21,14 +22,14 @@ class CloudFeature extends React.Component {
}
CloudFeature.contextTypes = {
store: React.PropTypes.object.isRequired,
router: React.PropTypes.object,
serviceStore: React.PropTypes.object
store: PropTypes.object.isRequired,
router: PropTypes.object,
serviceStore: PropTypes.object
};
CloudFeature.childContextTypes = {
store: React.PropTypes.object,
router: React.PropTypes.object
store: PropTypes.object,
router: PropTypes.object
};
export default connect()(CloudFeature);

View File

@@ -1,5 +1,6 @@
// Forked from: https://github.com/KyleAMathews/react-sparkline at commit a9d7c5203d8f240938b9f2288287aaf0478df013
import React from 'react';
import PropTypes from 'prop-types';
import { min as d3Min, max as d3Max, mean as d3Mean } from 'd3-array';
import { isoParse as parseDate } from 'd3-time-format';
import { line, curveLinear } from 'd3-shape';
@@ -9,9 +10,9 @@ import { formatMetricSvg } from '../utils/string-utils';
export default class Sparkline extends React.Component {
constructor(props, context) {
super(props, context);
this.x = scaleLinear();
this.y = scaleLinear();
this.line = line()
@@ -96,7 +97,7 @@ export default class Sparkline extends React.Component {
}
Sparkline.propTypes = {
data: React.PropTypes.arrayOf(React.PropTypes.object)
data: PropTypes.arrayOf(PropTypes.object)
};
Sparkline.defaultProps = {