init
This commit is contained in:
27
src/index.tsx
Normal file
27
src/index.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import ReactDom from 'react-dom';
|
||||
|
||||
import App from './app';
|
||||
|
||||
export default () => <App/>;
|
||||
|
||||
export const mount = (Сomponent) => {
|
||||
ReactDom.render(
|
||||
<Сomponent/>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
|
||||
if(module.hot) {
|
||||
module.hot.accept('./app', ()=> {
|
||||
ReactDom.render(
|
||||
<App/>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export const unmount = () => {
|
||||
ReactDom.unmountComponentAtNode(document.getElementById('app'));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user