Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix typos and code examples #5431

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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