✈️ migrate to static properies of ES7
proptypes should not be capital Add unit-test to check if separator has default value
This commit is contained in:
parent
33fdb393c7
commit
c5053cf334
6 changed files with 28 additions and 15 deletions
|
|
@ -1,11 +1,20 @@
|
|||
import React from 'react';
|
||||
import {buildURI} from '../core';
|
||||
import {defaultProps as CommonDefaultProps, PropTypes} from '../metaProps';
|
||||
|
||||
import {
|
||||
defaultProps as commonDefaultProps,
|
||||
propTypes as commonPropTypes} from '../metaProps';
|
||||
const defaultProps = {
|
||||
target: '_blank'
|
||||
};
|
||||
class CSVDownload extends React.Component {
|
||||
|
||||
static defaultProps = Object.assign(
|
||||
commonDefaultProps,
|
||||
defaultProps
|
||||
);
|
||||
|
||||
static propTypes = commonPropTypes;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={};
|
||||
|
|
@ -31,10 +40,4 @@ class CSVDownload extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
CSVDownload.defaultProps = Object.assign(
|
||||
CommonDefaultProps,
|
||||
defaultProps
|
||||
);
|
||||
CSVDownload.PropTypes = PropTypes;
|
||||
|
||||
export default CSVDownload;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,14 @@
|
|||
import React from 'react';
|
||||
import {buildURI} from '../core';
|
||||
import {defaultProps, PropTypes} from '../metaProps';
|
||||
import {
|
||||
defaultProps as commonDefaultProps,
|
||||
propTypes as commonPropTypes} from '../metaProps';
|
||||
|
||||
class CSVLink extends React.Component {
|
||||
|
||||
static defaultProps = commonDefaultProps;
|
||||
static propTypes = commonPropTypes;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.buildURI= this.buildURI.bind(this);
|
||||
|
|
@ -22,7 +28,5 @@ class CSVLink extends React.Component {
|
|||
)
|
||||
}
|
||||
}
|
||||
CSVLink.defaultProps = defaultProps;
|
||||
CSVLink.PropTypes = PropTypes;
|
||||
|
||||
export default CSVLink;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
|
||||
export const PropTypes = {
|
||||
export const propTypes = {
|
||||
data: React.PropTypes.oneOfType([
|
||||
React.PropTypes.string,
|
||||
React.PropTypes.array
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue