mirror of
https://github.com/icewind1991/mapboundaries.git
synced 2026-06-03 19:04:07 +02:00
boilerplate
This commit is contained in:
commit
abfdb9d2d9
9 changed files with 224 additions and 0 deletions
11
src/App.tsx
Normal file
11
src/App.tsx
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import * as React from 'react';
|
||||
|
||||
export interface AppState {
|
||||
|
||||
}
|
||||
|
||||
export class App extends React.Component<{}, AppState> {
|
||||
render() {
|
||||
return <div>app</div>;
|
||||
}
|
||||
}
|
||||
32
src/index.tsx
Normal file
32
src/index.tsx
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
'use strict';
|
||||
|
||||
import * as React from 'react';
|
||||
import {render} from 'react-dom';
|
||||
import {App} from './App';
|
||||
import {AppContainer} from 'react-hot-loader';
|
||||
|
||||
declare function require(path: string): any;
|
||||
declare const module: {
|
||||
hot: {
|
||||
accept: (path: string, cb: Function) => null
|
||||
}
|
||||
};
|
||||
|
||||
const root = document.createElement('div');
|
||||
document.body.appendChild(root);
|
||||
|
||||
render((
|
||||
<App/>
|
||||
), root);
|
||||
|
||||
if (module.hot) {
|
||||
module.hot.accept('./App', () => {
|
||||
const RootContainer = require('./App').App;
|
||||
render(
|
||||
<AppContainer>
|
||||
<RootContainer />
|
||||
</AppContainer>,
|
||||
root
|
||||
);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue