Skip to content

Commit

Permalink
Update getting-started.md
Browse files Browse the repository at this point in the history
Currently it is necessary to provide valid 'theme' and 'darkTheme' props to <HydraAdmin> or it fails with no useful error message.

- https://stackoverflow.com/questions/77840771/error-while-generate-an-admin-interface-using-api-platform-admin-and-react-admin

- marmelab/react-admin#9687
  • Loading branch information
jjsmclaughlin committed Mar 12, 2024
1 parent a3079fc commit 58538ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/getting-started.md
Expand Up @@ -27,10 +27,15 @@ For instance, if you used Create React App, replace the content of `src/App.js`
```javascript
import { HydraAdmin } from "@api-platform/admin";

import { defaultTheme } from 'react-admin';

const lightTheme = defaultTheme;
const darkTheme = { ...defaultTheme, palette: { mode: 'dark' } };

// Replace with your own API entrypoint
// For instance if https://example.com/api/books is the path to the collection of book resources, then the entrypoint is https://example.com/api
export default () => (
<HydraAdmin entrypoint="https://demo.api-platform.com" />
<HydraAdmin entrypoint="https://demo.api-platform.com" theme={lightTheme} darkTheme={darkTheme}/>
);
```

Expand Down

0 comments on commit 58538ef

Please sign in to comment.