Skip to content

easing bugs #18

@lemonleon

Description

@lemonleon
  1. easing 'spring' not support in steps, it will trigger a warning~
    like this
const steps = [{
  style: {
    opacity: 0,
  },
  duration: 400,
  easing: 'ease-in-out'
}, {
  style: {
    opacity: 1,
    transform: 'translate(0, 0)',
  },
  duration: 1000,
  easing: 'ease-out'
}, {
  style: {
    transform: 'translate(100px, 100px)',
  },
  duration: 1200,
  easing: 'spring'
}];

render() {
    return (
      <div className="simple">
        <button onClick={this.handleClick.bind(this)}>click me!</button>
        <Animate steps={steps} >
          <div style={{
                        width: 100,
                        height: 100,
                        backgroundColor: 'red'
                    }}
                    >
                    </div>
        </Animate>
      </div>
    );
  }
  1. if use steps, children is a function,animation will not be properly implemented'
    like this
const steps = [{
  style: {
    opacity: 0,
  },
  duration: 400,
  easing: 'ease-in-out'
}, {
  style: {
    opacity: 1,
    transform: 'translate(0, 0)',
  },
  duration: 1000,
  easing: 'ease-out'
}, {
  style: {
    transform: 'translate(100px, 100px)',
  },
  duration: 1200,
  easing: 'ease-in'
}];

render() {
    return (
      <div className="simple">
        <button onClick={this.handleClick.bind(this)}>click me!</button>
        <Animate steps={steps} onAnimationEnd={()=>{console.log('aaa');}}>
           {
                   (json) => {
                        console.log(json);

                        return (
                              <div style={{
                                width: 100,
                                height: 100,
                                backgroundColor: 'red'
                                }}
                               >
                               </div>
                         );
                   }
            }
        </Animate>
      </div>
    );
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions