mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-20 22:23:02 +03:00
react-router-dom 7 is superseded by react-router 8, which folds the DOM bindings back into the core package. RouterProvider now comes from `react-router/dom`, while the hooks and `createBrowserRouter` move to `react-router`. Updates the nine importing modules and the router line in docs/architecture.md to match. Also refreshes antd, react-i18next, storybook, eslint, lint-staged and playwright to current patch/minor releases, and restores alphabetical order in devDependencies for the @vitest/browser-playwright and playwright entries. Bumps brace-expansion to 5.0.8, the only release outside the affected range of GHSA-mh99-v99m-4gvg (unbounded expansion length causing an OOM crash). `npm audit fix` could not apply this on its own: the lockfile pinned 5.0.7 and npm will not re-resolve a transitive-only dependency in place, so the entry was updated directly and reinstalled.
34 lines
916 B
TypeScript
34 lines
916 B
TypeScript
import { createRoot } from 'react-dom/client';
|
|
import { RouterProvider } from 'react-router/dom';
|
|
import { message } from 'antd';
|
|
import 'antd/dist/reset.css';
|
|
import '@/styles/utils.css';
|
|
import '@/styles/page-shell.css';
|
|
import '@/styles/page-cards.css';
|
|
|
|
import { setupHttp } from '@/api/http-init';
|
|
import { readyI18n } from '@/i18n/react';
|
|
import { ThemeProvider } from '@/hooks/useTheme';
|
|
import { QueryProvider } from '@/api/QueryProvider';
|
|
import { router } from '@/routes';
|
|
|
|
setupHttp();
|
|
|
|
const messageContainer = document.getElementById('message');
|
|
if (messageContainer) {
|
|
message.config({ getContainer: () => messageContainer });
|
|
}
|
|
|
|
readyI18n().then(() => {
|
|
const root = document.getElementById('app');
|
|
if (root) {
|
|
createRoot(root).render(
|
|
<ThemeProvider>
|
|
<QueryProvider>
|
|
<RouterProvider router={router} />
|
|
</QueryProvider>
|
|
</ThemeProvider>,
|
|
);
|
|
}
|
|
});
|