How to use the rax.setNativeProps function in rax

To help you get started, we’ve selected a few rax 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 alibaba / rax / templates / template-retail / templates / default / pages / index / components / StoresNews / index.js View on Github external
timingFunction: 'ease-in-out',
      delay: 0,
      duration: 400
    });

    const curr = this.curr - 1;
    if (curr > 0 && curr % length === 0) {
      const round = curr / length;
      const itemRound = Math.round(round / 2);
      if (round % 2 === 1) {
        this.fastAnimate(this.animateElement1, this.itemHeight * length * 2 * itemRound);
      } else if (round % 2 === 0) {
        this.fastAnimate(this.animateElement2, this.itemHeight * length * (2 * itemRound + 1));
      }
      // 兼容安卓高度不够被内容被隐藏的bug
      setNativeProps(this.animateElement, {
        style: {
          height: this.itemHeight * this.itemHeight * length * (2 * itemRound + 2)
        }
      });
    }
  }
github alibaba / rax / templates / template-retail / templates / default / pages / index / components / LstRefreshControl / index.js View on Github external
this.props.onRefresh(() => {
      setNativeProps(findDOMNode(this._refresh), {
        display: 'hide'
      });
    });
  }
github alibaba / rax / components / rax-animated / src / index.js View on Github external
function ApplyAnimatedValues(instance, props) {
  setNativeProps(instance, {
    style: mapStyle(props.style)
  });
}
github alibaba / rax / packages / rax-textinput / src / index.js View on Github external
clear = () => {
    setNativeProps(this.refs.input, {value: ''});
  };
github alibaba / rax / components / rax-menulist / src / index.js View on Github external
animate = (visible) => {
    if (!this.menuList) {
      return;
    }

    const menuList = findDOMNode(this.menuList);
    if (visible) {
      setNativeProps(this.menuList, {
        style: {
          opacity: 0
        }
      });
      setTimeout(() => {
        transition(menuList, {
          opacity: 1
        }, {
          timingFunction: 'ease',
          delay: 0,
          duration: 300,
        }, () => {});
      }, 50);
    } else {
      setTimeout(() => {
        transition(menuList, {
github alibaba / rax / packages / rax-textinput / src / index.js View on Github external
componentWillReceiveProps(newProps) {
    setNativeProps(this.refs.input, {value: newProps.value});
  }