Addressed @rndstr's comment.

This commit is contained in:
Filip Barl
2017-08-08 14:42:16 +01:00
parent 322414b51f
commit c131fd1283
2 changed files with 3 additions and 6 deletions

View File

@@ -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);

View File

@@ -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