How to use the css-animation.isCssAnimationSupported function in css-animation

To help you get started, we’ve selected a few css-animation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-component / animate / tests / multiple.spec.js View on Github external
});

  afterEach(() => {
    try {
      ReactDOM.unmountComponentAtNode(container);
    } catch (e) {
      console.log(e);
      container.innerHTML = '';
    }
  });

  it('create works', () => {
    expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item').length).to.be(4);
  });

  if (!CssAnimation.isCssAnimationSupported) {
    return;
  }

  it('transitionLeave works', function t2(done) {
    this.timeout(5999);
    list.handleRemove(0);
    setTimeout(() => {
      expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item').length).to.be(4);
      if (!window.callPhantom) {
        expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item')[0].className)
          .to.contain('example-leave');
        expect(TestUtils.scryRenderedDOMComponentsWithClass(list, 'item')[0].className)
          .to.contain('example-leave-active');
      }
    }, 100);
    setTimeout(() => {
github react-component / animate / tests / single.spec.js View on Github external
render() {
      return (
        
          {options.remove &amp;&amp; !this.state.transitionEnter ? null : <div>child element</div>}
        
      );
    }
  };
}

if (CssAnimation.isCssAnimationSupported) {
  single(createClass, 'transition');
}
github fis-components / rc-animate / lib / AnimateChild.js View on Github external
transition: function transition(animationType, finishCallback) {
    var _this = this;

    var node = _react2['default'].findDOMNode(this);
    var props = this.props;
    var transitionName = props.transitionName;
    this.stop();
    var end = function end() {
      _this.stopper = null;
      finishCallback();
    };
    if ((_cssAnimation.isCssAnimationSupported || !props.animation[animationType]) && transitionName && props[transitionMap[animationType]]) {
      this.stopper = (0, _cssAnimation2['default'])(node, transitionName + '-' + animationType, end);
    } else {
      this.stopper = props.animation[animationType](node, end);
    }
  },