/**
 * Created by baoyinghai on 3/10/17.
 */
import React from 'react';
import ExtendButton from './index';


const injectButtonHook = (beforeRequest, afterRequest, beforeRouterChange) => {
  class CExtendButton extends React.Component {
    render() {
      const newProps = this.props;
      newProps.beforeRequest = beforeRequest;
      newProps.afterRequest = afterRequest;
      newProps.beforeRouterChange = beforeRouterChange;
      return (
        <ExtendButton {...newProps} />
      );
    }
  }
  return CExtendButton;
};

export default injectButtonHook;
