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 code examples #6449

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const themes = { light: lightTheme, dark: darkTheme };

export const ThemeContext = createContext(['light', () => {}])

const ThemeContextProvider = ({ value, children }) => (
const ThemeContextProvider = ({ value, children }) => {
const [theme, setTheme] = useState(value);
return (
<ThemeContext.Provider value={[theme, setTheme]}>
Expand Down
2 changes: 1 addition & 1 deletion docs/Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ const MyShowLayout = () => (
<div>
<Labeled resource="users" source="name">
<TextField source="name" />
</Label>
</Labeled>
</div>
);
```
Expand Down
5 changes: 4 additions & 1 deletion docs/Resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ to read the current resource name, use the `useResourceContext()` hook.
For instance, the following component displays the name of the current resource:

```jsx
import * as React from 'react';
import { Datagrid, DateField, TextField, List, useResourceContext } from 'react-admin';
WiXSL marked this conversation as resolved.
Show resolved Hide resolved

const ResourceName = () => {
const { resource } = useResourceContext();
return <>{resource}</>;
Expand All @@ -143,7 +146,7 @@ const PostList = (props) => (
<TextField source="title" />
<DateField source="published_at" />
</Datagrid>
<>
</>
</List>
)
```
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ Instead of wrapping the component under test with the `TestContext` by yourself
It will return the same output as the `render` method from `@testing-library/react` but will add the `dispatch` and `reduxStore` helpers.

```jsx
import { defaultStore } from 'ra-test'
...
import { defaultStore } from 'ra-test';
//...
const { dispatch, reduxStore, ...testUtils } = renderWithRedux(
<MyCustomEditView />,
initialState,
Expand Down