Skip to content

Commit 7fdb288

Browse files
committed
[Doc] Backport Trees's doc
1 parent 8705af5 commit 7fdb288

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/Tree.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The `<Tree>` component accepts the [rc-tree's `<Tree>`](https://github.com/react
5757
| `onSelect` | Optional | `function` | - | The function to execute when a node is selected. |
5858
| `selectedKeys` | Optional | `Identifier[]` | - | An array of identifiers defining the records that should be selected (controlled mode). |
5959
| `sx` | Optional | `SxProps` | - | Material UI shortcut for defining custom styles. |
60-
| `titleField` | Optional | `string` | `title` | Set the record field to display in the tree. |
60+
| `titleField` | Optional | `string` | - | Set the record field to display in the tree. |
6161

6262
### `className`
6363

@@ -364,7 +364,7 @@ export const SimpleTree = () => (
364364

365365
### `titleField`
366366

367-
Use the `titleField` prop to specify the name of the field holding the node title:
367+
The default node title uses the [`recordRepresentation`](./Resource.md#recordrepresentation) of the resource. Use the `titleField` prop to specify the name of the field holding the node title:
368368

369369
```tsx
370370
import { Tree } from '@react-admin/ra-tree';

docs/TreeWithDetails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Check [the `ra-tree` documentation](https://react-admin-ee.marmelab.com/document
8888
| `showLine` | Optional | `boolean` | `false` | Shows a connecting line |
8989
| `sx` | Optional | `SxProps` | - | Material UI shortcut for defining custom styles |
9090
| `title` | Optional | `string` | - | The title to display in the `<AppBar>` |
91-
| `titleField` | Optional | `string` | `title` | Set the record field to display in the tree |
91+
| `titleField` | Optional | `string` | - | Set the record field to display in the tree |
9292

9393
`<TreeWithDetails>` also accepts the [`<Tree>`](./Tree.md#props) props.
9494

@@ -443,7 +443,7 @@ The title can be either a string or an element of your own.
443443

444444
## `titleField`
445445

446-
Use the `titleField` prop to specify the name of the field holding the node title:
446+
The default node title uses the [`recordRepresentation`](./Resource.md#recordrepresentation) of the resource. Use the `titleField` prop to specify the name of the field holding the node title:
447447

448448
```tsx
449449
// in src/posts.js

0 commit comments

Comments
 (0)