Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 兼容 1.0 class 组件在 Web 下 transitionEnd 回调失效 #47

Merged
merged 2 commits into from
Apr 15, 2020

Conversation

balloonzzq
Copy link
Contributor

import findDOMNode from 'rax-find-dom-node';
import { createElement, Component, render } from 'rax';
import Text from 'rax-text';
import transition from 'universal-transition';

export default class App extends Component {

  constructor(props) {
    super(props);
    this.textRef = null;
  }

  componentDidMount() {
    const ref = this.textRef;

    transition(findDOMNode(ref), {
      opacity: '0.5'
    }, {
      duration: 1500
    }, () => {
      console.log('transition end');
    });
  }

  render() {
    return <Text ref={ref => this.textRef = ref}>test</Text>;
  }

}

在 web 下,该示例可复现 callback 失效。

@balloonzzq balloonzzq requested a review from SoloJiang March 10, 2020 09:11
@SoloJiang
Copy link
Collaborator

还要再看看为什么需要 setTimeout,以及顺手迁移一下 build-scripts 吧

@SoloJiang SoloJiang merged commit e2473c7 into master Apr 15, 2020
@delete-merged-branch delete-merged-branch bot deleted the fix-transition branch April 15, 2020 06:21
broven added a commit to broven/universal-api that referenced this pull request Apr 15, 2020
* 'master' of github.com:broven/universal-api:
  Feat quickapp asyncstorage (raxjs#77)
  fix: 兼容 1.0 class 组件在 Web 下 transitionEnd 回调失效 (raxjs#47)
  universal-unit-tool pkg (raxjs#70)
  fix: compaty node (raxjs#68)
  feat(device): support pixelRatio (raxjs#67)
  feat: support bytedance microapp in universal-env (raxjs#61)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants