Skip to content

Commit

Permalink
update tutorial RR version and actually use it
Browse files Browse the repository at this point in the history
  • Loading branch information
slax57 committed Jan 13, 2025
1 parent a6f7f24 commit 1d4d83f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"recharts": "^2.15.0"
},
"scripts": {
"dev": "vite",
"dev": "vite --force",
"build": "tsc && vite build",
"type-check": "tsc",
"preview": "vite preview"
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --force",
"build": "vite build",
"serve": "vite preview",
"type-check": "tsc --noEmit"
Expand Down
6 changes: 4 additions & 2 deletions examples/tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --force",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand All @@ -14,7 +14,9 @@
"ra-data-json-server": "^5.0.0",
"react": "^19.0.0",
"react-admin": "^5.0.0",
"react-dom": "^19.0.0"
"react-dom": "^19.0.0",
"react-router": "^7.0.0",
"react-router-dom": "^7.0.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
Expand Down
14 changes: 13 additions & 1 deletion examples/tutorial/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Admin, Resource, ShowGuesser } from 'react-admin';
import { Admin, CustomRoutes, Resource, ShowGuesser } from 'react-admin';
import jsonServerProvider from 'ra-data-json-server';
import PostIcon from '@mui/icons-material/Book';
import UserIcon from '@mui/icons-material/Group';
import { Route } from 'react-router';
import { Link } from 'react-router-dom';

import { PostList, PostEdit, PostCreate } from './posts';
import { UserList } from './users';
Expand Down Expand Up @@ -30,6 +32,16 @@ const App = () => (
icon={UserIcon}
recordRepresentation="name"
/>
<CustomRoutes>
<Route
path="/segments"
element={
<>
<Link to="path" />
</>
}
/>
</CustomRoutes>
</Admin>
);

Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19054,6 +19054,8 @@ __metadata:
react: "npm:^19.0.0"
react-admin: "npm:^5.0.0"
react-dom: "npm:^19.0.0"
react-router: "npm:^7.0.0"
react-router-dom: "npm:^7.0.0"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
Expand Down

0 comments on commit 1d4d83f

Please sign in to comment.