Skip to content

Commit

Permalink
Better placed documentation for nested JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
mccabemj committed Oct 19, 2018
1 parent 8d8f5e7 commit f34c652
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,6 @@ data = [
];
```

***Nested JSON data***

It is possible to reference nested strings in your data using dot notation

```js
headers = [
{ label: 'First Name', key: 'details.firstName' },
{ label: 'Last Name', key: 'details.lastName' },
{ label: 'Job', key: 'job' },
];

data = [
{ details: { firstName: 'Ahmed', lastName: 'Tomi' }, job: 'manager'},
{ details: { firstName: 'John', lastName: 'Jones' }, job: 'developer'},
];
```

**Example of strings**

```js
Expand Down Expand Up @@ -152,6 +135,23 @@ data = [
</CSVLink>;
```

##### Nested JSON data

It is possible to reference nested strings in your data using dot notation

```js
headers = [
{ label: 'First Name', key: 'details.firstName' },
{ label: 'Last Name', key: 'details.lastName' },
{ label: 'Job', key: 'job' },
];

data = [
{ details: { firstName: 'Ahmed', lastName: 'Tomi' }, job: 'manager'},
{ details: { firstName: 'John', lastName: 'Jones' }, job: 'developer'},
];
```

### - **separator** Props:

Following a request to add [this feature](https://github.com/abdennour/react-csv/issues/3) , from `1.0.1` release, `react-csv` supports `separator` props which is equals by default a comma `,` .
Expand Down

0 comments on commit f34c652

Please sign in to comment.