Skip to content

Commit db34cb8

Browse files
djhiMadeorsk
andauthored
Apply suggestions from code review
Co-authored-by: Madeorsk <[email protected]>
1 parent bc02cc4 commit db34cb8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/AutocompleteArrayInput.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,18 +329,18 @@ const filterToQuery = searchText => ({ name_ilike: `%${searchText}%` });
329329
`<AutocompleteArrayInput>` can display a custom message when it can't fetch the choices because there is no network connectivity, thanks to the `offline` prop.
330330

331331
```jsx
332-
<ReferenceArrayInput source="user_id" reference="users">
332+
<ReferenceArrayInput source="tag_ids" reference="tags">
333333
<AutocompleteArrayInput offline={<span>No network, could not fetch data</span>} />
334334
</ReferenceArrayInput>
335335
```
336336

337337
You can pass either a React element or a string to the `offline` prop:
338338

339339
```jsx
340-
<ReferenceArrayInput source="user_id" reference="users">
340+
<ReferenceArrayInput source="tag_ids" reference="tags">
341341
<AutocompleteArrayInput offline={<span>No network, could not fetch data</span>} />
342342
</ReferenceArrayInput>
343-
<ReferenceArrayInput source="user_id" reference="users">
343+
<ReferenceArrayInput source="tag_ids" reference="tags">
344344
<AutocompleteArrayInput offline="No network, could not fetch data" />
345345
</ReferenceArrayInput>
346346
```

packages/ra-core/src/form/choices/useChoicesContext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const useChoicesContext = <ChoicesType extends RaRecord = RaRecord>(
4141
hasPreviousPage:
4242
options.hasPreviousPage ?? list.hasPreviousPage,
4343
hideFilter: options.hideFilter ?? list.hideFilter,
44-
isFetching: list.isFetching ?? false, // same
45-
isLoading: list.isLoading ?? false, // we must take the one for useList, otherwise the loading state isn't synchronized with the data
44+
isFetching: list.isFetching ?? false, // we must take the one for useList, otherwise the loading state isn't synchronized with the data
45+
isLoading: list.isLoading ?? false, // same
4646
isPaused: list.isPaused ?? false, // same
4747
isPending: list.isPending ?? false, // same
4848
isPlaceholderData: list.isPlaceholderData ?? false, // same

0 commit comments

Comments
 (0)