From c131fd128391cc44ff35bba89e1b33be206aa817 Mon Sep 17 00:00:00 2001 From: Filip Barl Date: Tue, 8 Aug 2017 14:42:16 +0100 Subject: [PATCH] Addressed @rndstr's comment. --- client/app/scripts/charts/edge-container.js | 5 ++--- client/app/scripts/charts/node-container.js | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/app/scripts/charts/edge-container.js b/client/app/scripts/charts/edge-container.js index 369365f5b..981e8b0c4 100644 --- a/client/app/scripts/charts/edge-container.js +++ b/client/app/scripts/charts/edge-container.js @@ -2,7 +2,7 @@ import React from 'react'; import { Motion, spring } from 'react-motion'; import { Map as makeMap } from 'immutable'; import { line, curveBasis } from 'd3-shape'; -import { each, omit, times, constant } from 'lodash'; +import { each, times, constant } from 'lodash'; import { NODES_SPRING_ANIMATION_CONFIG } from '../constants/animation'; import { NODE_BASE_SIZE, EDGE_WAYPOINTS_CAP } from '../constants/styles'; @@ -70,8 +70,7 @@ export default class EdgeContainer extends React.PureComponent { } render() { - const { isAnimated, waypoints } = this.props; - const forwardedProps = omit(this.props, 'isAnimated', 'waypoints', 'scale'); + const { isAnimated, waypoints, scale, ...forwardedProps } = this.props; if (!isAnimated) { return transformedEdge(forwardedProps, waypoints.toJS(), this.state.thickness); diff --git a/client/app/scripts/charts/node-container.js b/client/app/scripts/charts/node-container.js index b811eda2c..0851035b7 100644 --- a/client/app/scripts/charts/node-container.js +++ b/client/app/scripts/charts/node-container.js @@ -1,5 +1,4 @@ import React from 'react'; -import { omit } from 'lodash'; import { Motion, spring } from 'react-motion'; import { NODES_SPRING_ANIMATION_CONFIG } from '../constants/animation'; @@ -16,8 +15,7 @@ const transformedNode = (otherProps, { x, y, k }) => ( export default class NodeContainer extends React.PureComponent { render() { - const { dx, dy, isAnimated, scale } = this.props; - const forwardedProps = omit(this.props, 'dx', 'dy', 'isAnimated', 'scale'); + const { dx, dy, isAnimated, scale, ...forwardedProps } = this.props; if (!isAnimated) { // Show static node for optimized rendering