WIP
This commit is contained in:
+11
-25
@@ -1,36 +1,22 @@
|
||||
/// <reference types="react/experimental" />
|
||||
/// <reference types="react-dom/experimental" />
|
||||
|
||||
import './index.css';
|
||||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import App from './App';
|
||||
import Translations_English from './translations/en';
|
||||
import {
|
||||
LanguageEnum,
|
||||
TranslationContext,
|
||||
} from './translations/TranslationContext';
|
||||
import { TranslationContext } from './translations/TranslationContext';
|
||||
|
||||
const element = document.getElementById('root');
|
||||
const rootElement = document.getElementById('root');
|
||||
if (!rootElement) throw new Error('Failed to find the root element');
|
||||
const root = ReactDOM.createRoot(rootElement);
|
||||
|
||||
if (element) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
ReactDOM.createRoot(element).render(
|
||||
<React.StrictMode>
|
||||
<TranslationContext.Provider
|
||||
value={{
|
||||
language: LanguageEnum.ENGLISH,
|
||||
translations: Translations_English,
|
||||
}}
|
||||
>
|
||||
<App />
|
||||
</TranslationContext.Provider>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
}
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<TranslationContext>
|
||||
<App />
|
||||
</TranslationContext>
|
||||
</React.StrictMode>,
|
||||
);
|
||||
|
||||
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.
|
||||
// Learn more: https://www.snowpack.dev/#hot-module-replacement
|
||||
|
||||
Reference in New Issue
Block a user