Skip to content

Commit 1bc3846

Browse files
authored
Merge pull request marmelab#10406 from marmelab/fix/treewithdetails_filter_doc
[Doc] Fix `<TreeWithDetails filter>` doc chapter
2 parents c5f6d4e + d41e143 commit 1bc3846

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/TreeWithDetails.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,18 @@ If you want to allow user to reorder nodes in the tree, simply add the `draggabl
245245
export const CategoriesList = () => <TreeWithDetails draggable />;
246246
```
247247

248-
249-
### `filter`
248+
## `filter`
250249

251250
You can choose to permanently filter the tree to display only a sub tree.
252251

253252
For instance, imagine you have one `employees` resource with a `department` field, and you want to display a tree for the Finance department. Use the `filter` prop to filter the tree:
254253

255254
{% raw %}
255+
256256
```jsx
257257
const EmployeeList = () => <TreeWithDetails filter={{ department: 'finance' }} />;
258258
```
259+
259260
{% endraw %}
260261

261262
**Note**: This only works if the filter field allows to extract a subtree with its own root node. If you use the `filter` prop to display a sparse selection of nodes (e.g. only the `male` employees), dragging nodes in this tree will not work as expected.

0 commit comments

Comments
 (0)