init brojs
All checks were successful
platform/bro-js/challenge-pl/pipeline/head This commit looks good

This commit is contained in:
Primakov Alexandr Alexandrovich
2025-11-02 17:44:37 +03:00
parent bc77227aeb
commit 3a65307fd0
23 changed files with 15460 additions and 0 deletions

28
src/index.tsx Normal file
View File

@@ -0,0 +1,28 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable react/display-name */
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './app'
export default () => <App/>
let rootElement: ReactDOM.Root
export const mount = (Component, element = document.getElementById('app')) => {
rootElement = ReactDOM.createRoot(element)
rootElement.render(<Component/>)
// @ts-ignore
if(module.hot) {
// @ts-ignore
module.hot.accept('./app', ()=> {
rootElement.render(<Component/>)
})
}
}
export const unmount = () => {
rootElement.unmount()
}