Skip to content

Commit 032e146

Browse files
authoredOct 20, 2022
Merge pull request #8280 from clement-escolano/patch-1
Add upgrade information about Field in SimpleForm
2 parents f50fca1 + f28b503 commit 032e146

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
 

‎docs/Upgrade.md

+22
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,28 @@ const PostCreate = () => (
17931793
)
17941794
```
17951795

1796+
### Field components must be wrapped with `<Labeled>` in `<SimpleForm>`
1797+
1798+
Field components don't have a label by default anymore and must be wrapped with `<Labeled>` when used within a `<SimpleForm>`.
1799+
1800+
```diff
1801+
const PostEdit = () => (
1802+
<Edit>
1803+
<SimpleForm>
1804+
<TextInput source="title">
1805+
- <ReferenceField source="author_id" reference="users">
1806+
- <TextField source="username" />
1807+
- </ReferenceField>
1808+
+ <Labeled label="Author">
1809+
+ <ReferenceField source="author_id" reference="users">
1810+
+ <TextField source="username" />
1811+
+ </ReferenceField>
1812+
+ </Labeled>
1813+
</SimpleForm>
1814+
</Edit>
1815+
)
1816+
```
1817+
17961818
### `<SimpleFormIterator>` Does Not Accept the `TransitionProps` prop anymore
17971819

17981820
Transitions were causing a lot of issues so we had to remove them for now, until we find a good solution.

0 commit comments

Comments
 (0)
Please sign in to comment.