react-csv/src/components/Download.js
abdennour 34fe75070a 📝 README updated 📝 👈🏼 ✏️ ☝🏼
2016-11-26 07:50:39 +03:00

31 lines
659 B
JavaScript

import React from 'react';
import {buildURI} from '../core';
import {defaultProps as CommonDefaultProps, PropTypes} from '../metaProps';
const defaultProps = {
target: '_blank'
};
class CSVDownload extends React.Component {
constructor(props) {
super(props);
}
componentDidMount(){
this.page = window.open(buildURI(this.props.data, this.props.headers), this.props.target, this.props.specs, this.props.replace);
}
getWindow() {
return this.page;
}
render(){
return (null)
}
}
CSVDownload.defaultProps = Object.assign(
CommonDefaultProps,
defaultProps
);
CSVDownload.PropTypes = PropTypes;
export default CSVDownload;