I tried using this new enclosingCharacter prop but it does not seem to work.
I tried using this new enclosingCharacter prop but it does not seem to work. I used it like explained in the README, that is with the following code:
<CSVLink data={csvData} separator=';' filename={csvName} enclosingCharacter={'}> {/* my button */} </CSVLink>
In the resulting downloaded CSV file, the enclosing characters are the default ones, that is double-quotes.
I read the files modified in this PR and everything seems OK. Could someone tell me if I am using it the wrong way?
Thanks in advance 😊
I also have same issue. Please someone provide solution for this.
it seems I found solution in component/link.js, enclosingCharacter parameter was not delivered correctly.
key: 'componentWillReceiveProps', value: function componentWillReceiveProps(nextProps) { var data = nextProps.data, headers = nextProps.headers, separator = nextProps.separator, uFEFF = nextProps.uFEFF, enclosingCharacter = nextProps.enclosingCharacter;
this.setState({ href: this.buildURI(data, uFEFF, headers, separator, enclosingCharacter) });
@bosscq seems correct. I will put a PR up to fix.
@bosscq seems correct. I will put a PR up to fix.
thx
hey folks! any update on this? just curious as encountered the same issue..
it's missing "enclosingCharacter" in the new version
componentDidUpdate(prevProps) {
if (this.props !== prevProps) {
const { data, headers, separator, uFEFF } = this.props;
this.setState({ href: this.buildURI(data, uFEFF, headers, separator) });
}
}
I also create it as a new issue https://github.com/react-csv/react-csv/issues/241