Reach equal standing with starting template from RRv7.

This commit is contained in:
2025-03-29 20:41:49 +01:00
parent 58620c057e
commit 584ced1cd5
11 changed files with 928 additions and 137 deletions

View File

@@ -1,12 +1,11 @@
import { StrictMode } from 'react'
import ReactDOM from 'react-dom/client'
import { RouterProvider, createRouter } from '@tanstack/react-router'
import { StrictMode } from 'react';
import ReactDOM from 'react-dom/client';
import { RouterProvider, createRouter } from '@tanstack/react-router';
// Import the generated route tree
import { routeTree } from './routeTree.gen'
import { routeTree } from './routeTree.gen';
import './styles.css'
import reportWebVitals from './reportWebVitals.ts'
import reportWebVitals from './reportWebVitals.ts';
// Create a new router instance
const router = createRouter({
@@ -16,27 +15,27 @@ const router = createRouter({
scrollRestoration: true,
defaultStructuralSharing: true,
defaultPreloadStaleTime: 0,
})
});
// Register the router instance for type safety
declare module '@tanstack/react-router' {
interface Register {
router: typeof router
router: typeof router;
}
}
// Render the app
const rootElement = document.getElementById('app')
const rootElement = document.getElementById('app');
if (rootElement && !rootElement.innerHTML) {
const root = ReactDOM.createRoot(rootElement)
const root = ReactDOM.createRoot(rootElement);
root.render(
<StrictMode>
<RouterProvider router={router} />
<RouterProvider router={router}/>
</StrictMode>,
)
);
}
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()
reportWebVitals();