Skip to content

Commit

Permalink
Merge pull request #8568 from marmelab/fix-docs
Browse files Browse the repository at this point in the history
[Doc] Fix  code examples
  • Loading branch information
fzaninotto authored Jan 16, 2023
2 parents 3efe54b + ca2d2b7 commit 2d10c7e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/ReferenceManyCount.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Use `<ReferenceManyCount>` as a regular Field in a `<Datagrid>` or `<SimpleShowL

```jsx
import {
ChipField
ChipField,
Datagrid,
DateField,
List,
Expand Down Expand Up @@ -163,4 +163,4 @@ The `<ReferenceManyCount>` component displays a loading indicator after 1 second
target="post_id"
timeout={500}
/>
```
```
16 changes: 8 additions & 8 deletions docs/ReferenceManyInput.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ By default, related records appear ordered by id desc. You can change this order

```jsx
<ReferenceManyInput
reference="variants"
target="product_id"
sort={{ field: 'sku', order: 'ASC' }}
reference="variants"
target="product_id"
sort={{ field: 'sku', order: 'ASC' }}
>
...
</ReferenceManyField>
</ReferenceManyInput>
```

{% endraw %}
Expand All @@ -242,12 +242,12 @@ You can override the style of the root component (a MUI [`<FormControl>`](https:

```jsx
<ReferenceManyInput
reference="variants"
target="product_id"
sx={{ marginLeft: 2 }}
reference="variants"
target="product_id"
sx={{ marginLeft: 2 }}
>
...
</ReferenceManyField>
</ReferenceManyInput>
```

{% endraw %}
Expand Down
11 changes: 5 additions & 6 deletions docs/useGetLock.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ const CustomToolbar = () => {
## Parameters
- `resource`: the resource name (e.g. `'posts'`)
- `params`: an object with the following properties:
- `id`: the record id (e.g. `123`)
- `meta`: Optional. an object that will be forwarded to the dataProvider (optional)
- `resource`: the resource name (e.g. `'posts'`)
- `params`: an object with the following properties:
- `id`: the record id (e.g. `123`)
- `meta`: Optional. an object that will be forwarded to the dataProvider
## Live Version
To get the list of locks update in real time based on the `lock/[resource]` topic, use [the `useGetLockLive` hook](./useGetLockLive.md) instead.
To get the list of locks update in real time based on the `lock/[resource]` topic, use [the `useGetLockLive` hook](./useGetLockLive.md) instead.
6 changes: 3 additions & 3 deletions docs/useInfiniteGetList.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ The second parameter is the query passed to `dataProvider.getList()`. It is an o
pagination: { page, perPage },
sort: { field, order },
filter: { ... },
meta: { ...}
meta: { ... }
}
```
Expand Down Expand Up @@ -158,7 +158,7 @@ const { data } = useInfiniteGetList(
pagination: { page: 1, perPage: 25 },
sort: { field: 'published_at', order: 'DESC' },
filter: { user_id: user && user.id },
}
},
{ enabled: !!user }
);
```
Expand Down Expand Up @@ -232,4 +232,4 @@ const LatestNews = () => {
</>
);
};
```
```

0 comments on commit 2d10c7e

Please sign in to comment.