UNPKG

yylib-quick-mobile

Version:

yylib-quick-mobile

33 lines 850 B
import React, {Component} from 'react'; import { ActivityIndicator } from 'antd-mobile'; import classnames from 'classnames'; class YYActivityIndicator extends Component { constructor(props) { super(props) this.state = { animating: props.animating }; } setAnimating(animating) { this.setState({ animating: animating }); } componentWillReceiveProps(nextprops){ this.setState({ animating: nextprops.animating }); } render() { let {...restProps} = this.props; let wrapClz = classnames('yy-activity-indicator', this.props.className); return ( <ActivityIndicator {...restProps} className={wrapClz} animating = {this.state.animating}/> ); } } YYActivityIndicator.defaultProps = {} export default YYActivityIndicator;