Skip to content

Commit

Permalink
Merge pull request #5431 from WiXSL/fix-docs
Browse files Browse the repository at this point in the history
[Doc] Fix typos and code examples
  • Loading branch information
djhi committed Oct 21, 2020
2 parents 40d478f + 80233f9 commit 9442fcf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/Authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const UserEdit = ({ permissions, ...props }) =>
```
{% endraw %}

What about the `List` view, the `DataGrid`, `SimpleList` and `Filter` components? It works there, too. And in the next example, the `permissions` prop is passed down to a custom `filters` component.
What about the `List` view, the `Datagrid`, `SimpleList` and `Filter` components? It works there, too. And in the next example, the `permissions` prop is passed down to a custom `filters` component.

```jsx
const UserFilter = ({ permissions, ...props }) =>
Expand Down
7 changes: 4 additions & 3 deletions docs/Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -916,14 +916,15 @@ import {
DateField,
SingleFieldList,
ChipField,
EditButton,
} from 'react-admin';
import { ReferenceManyToManyField } from '@react-admin/ra-many-to-many';

export const BookShow = (props) => (
export const BookShow = props => (
<Show {...props}>
<SimpleShowLayout>
<TextField source="title" />
<DateField source="publication_date">
<DateField source="publication_date" />
<ReferenceManyToManyField
reference="authors"
through="book_authors"
Expand Down Expand Up @@ -1125,7 +1126,7 @@ export const ProductList = (props) => (

React-admin usually delegates the rendering of field components to material-ui components. Refer to the material-ui documentation to see the default styles for elements.

You may want to customize the cell style inside a `DataGrid`. You can use the `cellClassName` for that:
You may want to customize the cell style inside a `Datagrid`. You can use the `cellClassName` for that:

{% raw %}
```jsx
Expand Down
3 changes: 1 addition & 2 deletions docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ The `<Datagrid>` is an **iterator** component: it gets an array of ids and a dat

By default, `<Datagrid>` renders its body using `<DatagridBody>`, an internal react-admin component. You can pass a custom component as the `body` prop to override that default. And by the way, `<DatagridBody>` has a `row` prop set to `<DatagridRow>` by default for the same purpose. `<DatagridRow>` receives the row `record`, the `resource`, and a copy of the `<Datagrid>` children. That means you can create custom datagrid logic without copying several components from the react-admin source.

For instance, the `<Datagrid isRowselectable>` prop allows to hide the selection checkbox for some records. To show a *disabled* checkbox instead of hiding it, you can override `<DatagridRow>` and `<DatagridBody>` as follows:
For instance, the `<Datagrid isRowSelectable>` prop allows to hide the selection checkbox for some records. To show a *disabled* checkbox instead of hiding it, you can override `<DatagridRow>` and `<DatagridBody>` as follows:

```jsx
// in src/PostList.js
Expand Down Expand Up @@ -2200,7 +2200,6 @@ const CustomList = () => {
/>
</ListContextProvider>
);
)
}
```
{% endraw %}
Expand Down

0 comments on commit 9442fcf

Please sign in to comment.