Skip to content

Commit 78da761

Browse files
committed
Improve documentation
1 parent 18e8882 commit 78da761

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

docs_headless/src/content/docs/SimpleFormIteratorBase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: "<SimpleFormIteratorBase>"
44
---
55

6-
`<SimpleFormIteratorBase>` helps building a component that lets users edit, add, remove and reorder sub-records. It is designed to be used as a child of [`<ArrayInputBase>`](./ArrayInputBase.md) or [`<ReferenceManyInput>`](./ReferenceManyInput.md). You can also use it within an `ArrayInputContext` containing a *field array*, i.e. the value returned by [react-hook-form's `useFieldArray` hook](https://react-hook-form.com/docs/usefieldarray).
6+
`<SimpleFormIteratorBase>` helps building a component that lets users edit, add, remove and reorder sub-records. It is designed to be used as a child of [`<ArrayInputBase>`](./ArrayInputBase.md) or [`<ReferenceManyInput>`](https://react-admin-ee.marmelab.com/documentation/ra-core-ee#referencemanyinputbase). You can also use it within an `ArrayInputContext` containing a *field array*, i.e. the value returned by [react-hook-form's `useFieldArray` hook](https://react-hook-form.com/docs/usefieldarray).
77

88
## Usage
99

packages/ra-core/src/controller/input/ArrayInputBase.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ import {
1616
import { ArrayInputContext } from './ArrayInputContext';
1717

1818
/**
19-
* To edit arrays of data embedded inside a record, <ArrayInput> creates a list of sub-forms.
19+
* To edit arrays of data embedded inside a record, <ArrayInputBase> creates a list of sub-forms.
2020
*
2121
* @example
2222
*
23-
* import { ArrayInput, SimpleFormIterator, DateInput, TextInput } from 'react-admin';
23+
* import { ArrayInputBase } from 'react-admin';
24+
* import { SimpleFormIterator, DateInput, TextInput } from 'my-react-admin-ui';
2425
*
25-
* <ArrayInput source="backlinks">
26+
* <ArrayInputBase source="backlinks">
2627
* <SimpleFormIterator>
2728
* <DateInput source="date" />
2829
* <TextInput source="url" />
2930
* </SimpleFormIterator>
30-
* </ArrayInput>
31+
* </ArrayInputBase>
3132
*
32-
* <ArrayInput> allows the edition of embedded arrays, like the backlinks field
33+
* <ArrayInputBase> allows the edition of embedded arrays, like the backlinks field
3334
* in the following post record:
3435
*
3536
* {
@@ -46,13 +47,10 @@ import { ArrayInputContext } from './ArrayInputContext';
4647
* ]
4748
* }
4849
*
49-
* <ArrayInput> expects a single child, which must be a *form iterator* component.
50+
* <ArrayInputBase> expects a single child, which must be a *form iterator* component.
5051
* A form iterator is a component accepting a fields object as passed by
5152
* react-hook-form-arrays's useFieldArray() hook, and defining a layout for
52-
* an array of fields. For instance, the <SimpleFormIterator> component
53-
* displays an array of fields in an unordered list (<ul>), one sub-form by
54-
* list item (<li>). It also provides controls for adding and removing
55-
* a sub-record (a backlink in this example).
53+
* an array of fields.
5654
*
5755
* @see {@link https://react-hook-form.com/docs/usefieldarray}
5856
*/

0 commit comments

Comments
 (0)