Skip to content

Commit 014df30

Browse files
committed
Add React TanStack Router sample app
Introduced a new sample application under samples/react-tanstack-router demonstrating integration of Asgardeo authentication with TanStack Router in a React app. Updated the TanStack Router package README to reference the new sample. Added related configuration, source files, and dependencies.
1 parent cd7b417 commit 014df30

File tree

17 files changed

+968
-62
lines changed

17 files changed

+968
-62
lines changed

packages/tanstack-router/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,7 @@ const dashboardRoute = createRoute({
254254

255255
Check out our sample applications in the repository:
256256

257-
- [React Sample](../../samples/asgardeo-react) - Complete React application with Asgardeo authentication
258-
- [Next.js Sample](../../samples/asgardeo-nextjs) - Next.js application example
259-
- [Teamspace React](../../samples/teamspace-react) - Team collaboration app with React
260-
- [Teamspace Next.js](../../samples/teamspace-nextjs) - Team collaboration app with Next.js
257+
- [React TanStack Router Sample](../../samples/react-tanstack-router) - Simple React application demonstrating TanStack Router integration with protected routes
261258

262259
## TypeScript Support
263260

packages/tanstack-router/src/components/__tests__/ProtectedRoute.test.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
* under the License.
1717
*/
1818

19-
import { describe, it, expect, vi, beforeEach } from 'vitest';
20-
import { render, screen } from '@testing-library/react';
19+
import {describe, it, expect, vi, beforeEach} from 'vitest';
20+
import {render, screen} from '@testing-library/react';
2121
import ProtectedRoute from '../ProtectedRoute';
22-
import { useAsgardeo } from '@asgardeo/react';
22+
import {useAsgardeo} from '@asgardeo/react';
2323

24-
// Mock the dependencies
2524
vi.mock('@asgardeo/react', () => ({
2625
useAsgardeo: vi.fn(),
2726
AsgardeoRuntimeError: class AsgardeoRuntimeError extends Error {
@@ -40,7 +39,7 @@ vi.mock('@asgardeo/react', () => ({
4039
}));
4140

4241
vi.mock('@tanstack/react-router', () => ({
43-
Navigate: ({ to }: { to: string }) => <div data-testid="navigate">Navigate to: {to}</div>,
42+
Navigate: ({to}: {to: string}) => <div data-testid="navigate">Navigate to: {to}</div>,
4443
}));
4544

4645
describe('ProtectedRoute', () => {

0 commit comments

Comments
 (0)