message: Rewrite PullToRefreshSpinner to functional component
diff: -import React, { PureComponent } from 'react';
  +import React from 'react';
  import PropTypes from 'prop-types';
  import classNames from '../../lib/classNames';
  @@ -7,38 +7,11 @@ function calcStrokeDashOffset (value, radius) {
  return 2 * Math.PI * radius * (1 - progress);
  }
  -export default class PullToRefreshSpinner extends PureComponent {
  - constructor (props) {
  - super(props);
  -
  - const { size, strokeWidth } = this.props;
  -
  +const PullToRefreshSpinner = React.memo(({on, progress, size, strokeWidth, style}) => {
  const radius = 0.5 * size - 0.5 * strokeWidth;
  const dasharray = 2 * Math.PI * radius;
  const circleCenter = 0.5 * size;
  - this.state = { radius, dasharray, circleCenter };
  - }
  -
  - static propTypes = {
  - size: PropTypes.number,
  - strokeWidth: PropTypes.number,
  - on: PropTypes.bool,
  - progress: PropTypes.number,
  - style: PropTypes.object
  - };
  -
  - static defaultProps = {
  - size: 24,
  - strokeWidth: 2.5,
  - on: true,
  - progress: null
  - };
  -
  - render () {
  - const { on, progress, size, strokeWidth, style } = this.props;
  - const { radius, dasharray, circleCenter } = this.state;
  -
  const dashoffset = calcStrokeDashOffset(on ? 80 : progress, radius);
  return (
  @@ -79,5 +52,21 @@ export default class PullToRefreshSpinner extends PureComponent {
  </svg>
  </div>
  );
  - }
  -}
  +});
  +
  +PullToRefreshSpinner.propTypes = {
  + size: PropTypes.number,
  + strokeWidth: PropTypes.number,
  + on: PropTypes.bool,
  + progress: PropTypes.number,
  + style: PropTypes.object
  +};
  +
  +PullToRefreshSpinner.defaultProps = {
  + size: 24,
  + strokeWidth: 2.5,
  + on: true,
  + progress: null
  +};
  +
  +export default PullToRefreshSpinner;
  