You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`authLoading`| Optional |`ReactNode`| - | The component to display while checking for authentication |
61
+
|`children`| Optional *|`ReactNode`| - | The components that render the form |
62
+
|`render`| Optional *|`function`| - | Alternative to children. Function that renders the form, receives the create context as argument |
63
+
|`actions`| Optional |`ReactNode`| Default toolbar | Override the actions toolbar with a custom component |
64
+
|`aside`| Optional |`ReactNode`| - | Component to render aside to the main content |
65
+
|`className`| Optional |`string`| - | Passed to the root component |
66
+
|`component`| Optional |`string`/`Component`|`Card`| Override the root component |
67
+
|`disableAuthentication`| Optional |`boolean`|`false`| Disable the authentication check |
68
+
|`mutationMode`| Optional |`string`|`pessimistic`| Switch to optimistic or undoable mutations |
69
+
|`mutationOptions`| Optional |`object`| - | Options for the `dataProvider.create()` call |
70
+
|`record`| Optional |`object`|`{}`| Initialize the form with a record |
71
+
|`redirect`| Optional |`string`/`function`|`'edit'`| Change the redirect location after successful creation |
72
+
|`resource`| Optional |`string`| From URL | Override the name of the resource to create |
73
+
|`sx`| Optional |`object`| - | Override the styles |
74
+
|`title`| Optional |`string`/`ReactNode`| Translation | Override the page title |
75
+
|`transform`| Optional |`function`| - | Transform the form data before calling `dataProvider.create()`|
75
76
76
77
`*` You must provide either `children` or `render`.
77
78
@@ -125,6 +126,20 @@ const PostCreate = () => (
125
126
126
127
{% endraw %}
127
128
129
+
## `authLoading`
130
+
131
+
By default, `<Create>` renders the `<Loading>` component while checking for authentication and permissions. You can display a custom component via the `authLoading` prop:
132
+
133
+
```jsx
134
+
import { Create } from'react-admin';
135
+
136
+
exportconstPostCreate= () => (
137
+
<Create authLoading={<p>Checking for permissions...</p>}>
138
+
...
139
+
</Create>
140
+
);
141
+
```
142
+
128
143
## `children`
129
144
130
145
The `<Create>` component will render its children inside a [`CreateContext`](./useCreateContext.md#return-value). Children can be any React node, but are usually a form component like [`<SimpleForm>`](./SimpleForm.md), [`<TabbedForm>`](./TabbedForm.md), or the headless [`<Form>`](./Form.md) component.
0 commit comments