Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: marmelab/react-admin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1968a9f98e0184da9dcf1e392bc0d2e3fa07f53f
Choose a base ref
..
head repository: marmelab/react-admin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 95bb4c9e4f956d970e80d49aa73366a2e61790b4
Choose a head ref
5 changes: 5 additions & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ title: "FAQ"
- [How can I customize forms depending on its inputs values?](#how-can-i-customize-forms-depending-on-its-inputs-values)
- [UI in production build is empty or broken](#ui-in-production-build-is-empty-or-broken)
- [My Resource is defined but not displayed on the Menu](#my-resource-is-defined-but-not-displayed-on-the-menu)
- [Can I use react-router v7?](#can-i-use-react-router-v7)

## Can I have custom identifiers/primary keys for my resources?

@@ -167,3 +168,7 @@ export const MyMenu = () => (
</Menu>
);
```

## Can I use react-router v7

You can use react-router v7 with React-admin. Note that some package managers may require you to add [overrides (NPM)](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides) or [resolutions (Yarn)](https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/) in order to avoid dependencies conflict with React-admin.
2 changes: 2 additions & 0 deletions examples/demo/package.json
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@
"react": "^19.0.0",
"react-admin": "^5.0.0",
"react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"recharts": "^2.15.0"
},
"scripts": {
2 changes: 1 addition & 1 deletion examples/demo/src/layout/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useState } from 'react';
import { useLocation } from 'react-router';
import { useLocation } from 'react-router-dom';

import {
Avatar,
2 changes: 1 addition & 1 deletion examples/demo/src/reviews/ReviewList.tsx
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import {
TopToolbar,
useDefaultTitle,
} from 'react-admin';
import { matchPath, useLocation, useNavigate } from 'react-router';
import { matchPath, useLocation, useNavigate } from 'react-router-dom';
import { Box, Drawer, useMediaQuery, Theme } from '@mui/material';

import ReviewListMobile from './ReviewListMobile';
2 changes: 0 additions & 2 deletions packages/react-admin/package.json
Original file line number Diff line number Diff line change
@@ -26,8 +26,6 @@
"watch": "tsc --outDir dist/esm --module es2015 --watch"
},
"devDependencies": {
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"cross-env": "^5.2.0",
"expect": "^27.4.6",
"react-router": "^6.25.1",
4 changes: 2 additions & 2 deletions packages/react-admin/src/Admin.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { render, screen } from '@testing-library/react';

import { Basic, InsideRouter, SubPath, DefaultError } from './Admin.stories';

@@ -25,7 +25,7 @@ describe('<Admin>', () => {

it('works when mounted in a subPath', async () => {
render(<SubPath />);
fireEvent.click(await screen.findByText('Go to admin'));
screen.getByText('Go to admin').click();
await screen.findByText('Post List');
screen.getAllByText('Comments')[0].click();
await screen.findByText('Comment List');
7 changes: 0 additions & 7 deletions test-setup.js
Original file line number Diff line number Diff line change
@@ -26,10 +26,3 @@ global.Request = Request;

/** Mock scrollTo as it is not supported by JSDOM */
global.scrollTo = jest.fn();

/** Mock TextEncoder as it is not supported by JSDOM */
if (!global.TextEncoder || !global.TextDecoder) {
const { TextDecoder, TextEncoder } = require('node:util');
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
}
10 changes: 6 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -2846,7 +2846,7 @@ __metadata:
languageName: node
linkType: hard

"@mui/icons-material@npm:^6.0.0":
"@mui/icons-material@npm:^5.16.12 || ^6.0.0, @mui/icons-material@npm:^6.0.0":
version: 6.3.1
resolution: "@mui/icons-material@npm:6.3.1"
dependencies:
@@ -2895,7 +2895,7 @@ __metadata:
languageName: node
linkType: hard

"@mui/material@npm:^6.0.0":
"@mui/material@npm:^5.16.12 || ^6.0.0, @mui/material@npm:^6.0.0":
version: 6.3.1
resolution: "@mui/material@npm:6.3.1"
dependencies:
@@ -8514,6 +8514,8 @@ __metadata:
react: "npm:^19.0.0"
react-admin: "npm:^5.0.0"
react-dom: "npm:^19.0.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
recharts: "npm:^2.15.0"
rewire: "npm:^5.0.0"
rollup-plugin-visualizer: "npm:^5.12.0"
@@ -16536,8 +16538,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "react-admin@workspace:packages/react-admin"
dependencies:
"@mui/icons-material": "npm:^5.16.12"
"@mui/material": "npm:^5.16.12"
"@mui/icons-material": "npm:^5.16.12 || ^6.0.0"
"@mui/material": "npm:^5.16.12 || ^6.0.0"
cross-env: "npm:^5.2.0"
expect: "npm:^27.4.6"
ra-core: "npm:^5.4.3"