Files
fredy/ui/src/Index.jsx

28 lines
915 B
React
Raw Permalink Normal View History

2025-12-11 10:40:55 +01:00
/*
* Copyright (c) 2026 by Christian Kellner.
2025-12-11 10:40:55 +01:00
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
*/
import { HashRouter } from 'react-router-dom';
2022-12-19 21:10:00 +01:00
import { createRoot } from 'react-dom/client';
import en_US from '@douyinfe/semi-ui-19/lib/es/locale/source/en_US';
import { LocaleProvider, semiGlobal } from '@douyinfe/semi-ui-19';
2025-09-03 09:45:09 +02:00
import App from './App';
import './Index.less';
2023-03-20 08:52:13 +01:00
// Semi UI uses react-dom (not react-dom/client) internally for imperative renders
// like Toast, Notification, etc. In React 19, createRoot was removed from react-dom
2026-04-27 16:56:04 +02:00
// and lives only in react-dom/client - inject it so Toast can create its own root.
semiGlobal.config.createRoot = createRoot;
2022-12-19 21:10:00 +01:00
const container = document.getElementById('fredy');
const root = createRoot(container);
2022-12-19 21:10:00 +01:00
root.render(
<HashRouter>
<LocaleProvider locale={en_US}>
<App />
</LocaleProvider>
</HashRouter>,
);