boilerplate

This commit is contained in:
Robin Appelman 2017-04-14 20:31:30 +02:00
commit abfdb9d2d9
9 changed files with 224 additions and 0 deletions

11
src/App.tsx Normal file
View 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
View 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
);
});
}