Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #283 from FormidableLabs/improvement/animate-true
Browse files Browse the repository at this point in the history
support boolean animate prop
  • Loading branch information
boygirl authored Aug 5, 2017
2 parents abf6923 + 1e1ff08 commit 3bbe3ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/victory-transition/victory-transition.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import Collection from "../victory-util/collection";
import Helpers from "../victory-util/helpers";
import Timer from "../victory-util/timer";
import Transitions from "../victory-util/transitions";
import { defaults, isFunction, pick } from "lodash";
import { defaults, isFunction, pick, isObject } from "lodash";

export default class VictoryTransition extends React.Component {
static displayName = "VictoryTransition";

static propTypes = {
animate: PropTypes.object,
animate: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]),
animationWhitelist: PropTypes.array,
children: PropTypes.node
};
Expand Down Expand Up @@ -116,7 +116,7 @@ export default class VictoryTransition extends React.Component {
}

pickDomainProps(props) {
const parentState = props.animate && props.animate.parentState;
const parentState = isObject(props.animate) && props.animate.parentState;
if (parentState && parentState.nodesWillExit) {
return this.continous || parentState.continuous ?
parentState.nextProps || this.state.nextProps || props : props;
Expand All @@ -135,7 +135,7 @@ export default class VictoryTransition extends React.Component {

render() {
const props = this.pickProps();
const getTransitionProps = this.props.animate && this.props.animate.getTransitions ?
const getTransitionProps = isObject(this.props.animate) && this.props.animate.getTransitions ?
this.props.animate.getTransitions :
Transitions.getTransitionPropsFactory(
props,
Expand Down

0 comments on commit 3bbe3ca

Please sign in to comment.