initial commit
This commit is contained in:
15
src/app.tsx
Normal file
15
src/app.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<h1>
|
||||
Hello world для проекта - kfu-24-teacher asd as das das d as{' '}
|
||||
<div>
|
||||
{' '}
|
||||
asda s <span>123</span>
|
||||
</div>
|
||||
</h1>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
23
src/index.tsx
Normal file
23
src/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
|
||||
import App from './app';
|
||||
|
||||
export default () => <App />;
|
||||
|
||||
let rootElement: ReactDOM.Root;
|
||||
|
||||
export const mount = (Сomponent, element = document.getElementById('app')) => {
|
||||
const rootElement = ReactDOM.createRoot(element);
|
||||
rootElement.render(<Сomponent />);
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept('./app', () => {
|
||||
rootElement.render(<Сomponent />);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export const unmount = () => {
|
||||
rootElement.unmount();
|
||||
};
|
||||
Reference in New Issue
Block a user