Skip to content

Commit cfabe20

Browse files
committed
Add advice for error
1 parent 0a18b80 commit cfabe20

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/ReactRouterFramework.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ This script will ask you for more details about your project. You can use the fo
2727

2828
Next, add the required dependencies. In addition to the `react-admin` npm package, you will need a data provider package. In this example, we'll use `ra-data-json-server` to connect to a test API provided by [JSONPlaceholder](https://jsonplaceholder.typicode.com).
2929

30-
`react-admin` also depends on the `react-router-dom` package. It used to be a direct dependency of `react-router`, but it's not anymore in v7 so you'll have to add it manually. Check the version of React Router that has been installed by `create-react-router` and **use the exact same version**. At the time of writing this tutorial, it is `7.11.0`.
30+
`react-admin` also depends on the `react-router-dom` package. It used to be a direct dependency of `react-router`, but it's not anymore in v7 so you'll have to add it manually. Check the version of React Router that has been installed by `create-react-router` and **use the exact same version**. At the time of writing this tutorial, it is `7.10.1`.
3131

3232
```sh
3333
cd react-router-admin
34-
npm add react-admin ra-data-json-server react-router-dom@7.11.0
34+
npm add react-admin ra-data-json-server react-router-dom@7.10.1
3535
```
3636

3737
## Adding React-Admin In A Sub Route
@@ -71,6 +71,8 @@ export default function App() {
7171

7272
You can now start the app in development mode with `npm run dev`. The admin should render at <http://localhost:5173/admin/>.
7373

74+
**Tip**: If you're getting a `ReferenceError: document is not defined`error at this stage, it's probably because the versions of `react-router` and `react-router-dom` are mismatched. Make sure to use the exact same version for both packages.
75+
7476
## Adding an API
7577

7678
[React Router allows to serve an API](https://reactrouter.com/how-to/resource-routes) from the same server. You *could* use this to build a CRUD API by hand. However, we consider that building a CRUD API on top of a relational database is a solved problem and that developers shouldn't spend time reimplementing it.

0 commit comments

Comments
 (0)