Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fargito committed May 28, 2019
1 parent c5fb016 commit 2513035
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,15 @@ You can also prevent `<ReferenceField>` from adding link to children by setting
</ReferenceField>
```

You can also use a custom `linkType` function to get a custom path for the children.

```jsx
// Custom path
<ReferenceField label="User" source="userId" reference="users" linkType={() => '/my/path'}>
<TextField source="name" />
</ReferenceField>
```

**Tip**: React-admin uses `CRUD_GET_ONE_REFERENCE` action to accumulate and deduplicate the ids of the referenced records to make *one* `GET_MANY` call for the entire list, instead of n `GET_ONE` calls. So for instance, if the API returns the following list of comments:

```jsx
Expand Down

0 comments on commit 2513035

Please sign in to comment.