Skip to content

Commit 771e8b4

Browse files
authored
Merge pull request marmelab#10671 from marmelab/doc-dialog-forms-hasCreate
[Doc] Fix Dialog Forms examples regarding `hasCreate`
2 parents 0d4cce4 + 6c3a657 commit 771e8b4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

docs/CreateDialog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,14 +468,15 @@ Add the `warnWhenUnsavedChanges` prop to your Form like so:
468468
import React from 'react';
469469
import {
470470
List,
471+
ListActions,
471472
Datagrid,
472473
SimpleForm,
473474
} from 'react-admin';
474475
import { CreateDialog } from '@react-admin/ra-form-layout';
475476

476477
const CustomerList = () => (
477478
<>
478-
<List hasCreate>
479+
<List actions={<ListActions hasCreate />}>
479480
<Datagrid rowClick="edit">
480481
...
481482
</Datagrid>

docs/EditDialog.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ Here is an example:
245245
import React from 'react';
246246
import {
247247
List,
248+
ListActions,
248249
Datagrid,
249250
SimpleForm,
250251
TextInput,
@@ -265,7 +266,7 @@ const CustomerEditTitle = () => {
265266

266267
const CustomerList = () => (
267268
<>
268-
<List hasCreate>
269+
<List actions={<ListActions hasCreate />}>
269270
<Datagrid rowClick="edit">
270271
...
271272
</Datagrid>
@@ -510,14 +511,15 @@ Add the `warnWhenUnsavedChanges` prop to your Form like so:
510511
import React from 'react';
511512
import {
512513
List,
514+
ListActions,
513515
Datagrid,
514516
SimpleForm,
515517
} from 'react-admin';
516518
import { EditDialog } from '@react-admin/ra-form-layout';
517519

518520
const CustomerList = () => (
519521
<>
520-
<List hasCreate>
522+
<List actions={<ListActions hasCreate />}>
521523
<Datagrid rowClick="edit">
522524
...
523525
</Datagrid>

0 commit comments

Comments
 (0)