clear more warnings

main
Joost Wooning 2022-02-14 14:52:09 +01:00
parent 8054407ac4
commit b8f8d21478
4 changed files with 7 additions and 12 deletions

View File

@ -41,7 +41,7 @@
"moment": "^2.18.1",
"node-sass": "^7.0.1",
"prettier": "^1.9.2",
"prop-types": "^15.5.10",
"prop-types": "^15.8.1",
"query-string": "^5.0.1",
"randomcolor": "^0.5.4",
"raven-js": "^3.16.0",

View File

@ -31,7 +31,7 @@ export default class CanGraph extends Component {
onSegmentChanged: PropTypes.func,
onDragStart: PropTypes.func,
onDragEnd: PropTypes.func,
container: PropTypes.node,
container: PropTypes.object,
dragPos: PropTypes.object,
canReceiveGraphDrop: PropTypes.bool,
onGraphRefAvailable: PropTypes.func,

View File

@ -27,10 +27,9 @@ export default class CanGraphList extends Component {
graphToReceiveDrop: null
};
this.plotListRef = null;
this.plotListRef = React.createRef();
this.plotRefs = [];
this.renderSignalPlot = this.renderSignalPlot.bind(this);
this.onPlotListRefReady = this.onPlotListRefReady.bind(this);
this.onGraphDragStart = this.onGraphDragStart.bind(this);
this.onGraphDragEnd = this.onGraphDragEnd.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
@ -116,7 +115,7 @@ export default class CanGraphList extends Component {
const { draggingSignal, graphToReceiveDrop } = this.state;
const { messageId, signalUid } = plottedSignals[0];
const msg = this.props.messages[messageId];
if (!this.plotListRef || !msg) {
if (!this.plotListRef.current || !msg) {
return [];
}
@ -154,7 +153,7 @@ export default class CanGraphList extends Component {
currentTime={this.props.seekTime}
onDragStart={this.onGraphDragStart}
onDragEnd={this.onGraphDragEnd}
container={this.plotListRef}
container={this.plotListRef.current}
dragPos={isDragging ? this.state.dragPos : null}
canReceiveGraphDrop={canReceiveGraphDrop}
plottedSignals={plottedSignals}
@ -163,15 +162,11 @@ export default class CanGraphList extends Component {
);
}
onPlotListRefReady(ref) {
this.plotListRef = ref;
}
render() {
return (
<div
className="cabana-explorer-visuals-plots"
ref={this.onPlotListRefReady}
ref={ this.plotListRef }
onMouseMove={this.onMouseMove}
onMouseLeave={this.onGraphDragEnd}
onMouseUp={this.onGraphDragEnd}

View File

@ -11584,7 +11584,7 @@ prop-types-exact@^1.2.0:
object.assign "^4.1.0"
reflect.ownkeys "^0.2.0"
prop-types@15, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@15, prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==