import React, { Component } from "react"; import { Button } from 'antd'; const htmlPrefix = `
` const htmlSuffix = ` ` export default class ExcelButton extends Component { constructor(props, context) { super(props, context); this.state = { table: '' }; } componentDidMount() { } componentWillReceiveProps(props) { if(props.table) { const type = Object.prototype.toString.call(props.table).slice(8, -1); switch(type) { case 'HTMLTableElement': this.setState({ table: props.table.outerHTML }); break; case 'String': this.setState({ table: props.table }); break; } } } render() { return ( ); } }