inital commit
This commit is contained in:
20
src/routes/__root.tsx
Normal file
20
src/routes/__root.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import {createRootRoute, Link, Outlet} from "@tanstack/react-router";
|
||||
import {TanStackRouterDevtools} from '@tanstack/router-devtools'
|
||||
|
||||
export const Route = createRootRoute({
|
||||
component: () => (
|
||||
<>
|
||||
<div className="p-2 flex gap-2">
|
||||
<Link to="/" className="[&.active]:font-bold">
|
||||
Home
|
||||
</Link>{' '}
|
||||
<Link to="/test" className="[&.active]:font-bold">
|
||||
Test
|
||||
</Link>{' '}
|
||||
</div>
|
||||
|
||||
<Outlet/>
|
||||
<TanStackRouterDevtools/>
|
||||
</>
|
||||
),
|
||||
})
|
||||
6
src/routes/index.lazy.tsx
Normal file
6
src/routes/index.lazy.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import {createLazyFileRoute} from "@tanstack/react-router";
|
||||
import MainPage from "../pages/MainPage/MainPage.tsx";
|
||||
|
||||
export const Route = createLazyFileRoute('/')({
|
||||
component: MainPage,
|
||||
})
|
||||
18
src/routes/test.lazy.tsx
Normal file
18
src/routes/test.lazy.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import {createLazyFileRoute} from "@tanstack/react-router";
|
||||
import {Button} from "@mantine/core";
|
||||
import {notifications} from "@mantine/notifications";
|
||||
|
||||
export const Route = createLazyFileRoute('/test')({
|
||||
component: TestPage
|
||||
})
|
||||
|
||||
function TestPage() {
|
||||
return (
|
||||
<>
|
||||
<Button onClick={() => {
|
||||
notifications.show({title: "test", message: "хуй"})
|
||||
}}>TEST</Button>
|
||||
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user