mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 17:51:21 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user