Anyway under typescript the example actually becomes:
import * as ReactHabitat from 'react-habitat';
import { Hello } from './components/Hello';
class MyApp extends ReactHabitat.default.Bootstrapper {
constructor(){
super();
// Create a new container builder
var container = new ReactHabitat.default.Container();
// Register your top level component(s) (ie mini/child apps)
container.register('Hello', Hello);
// Finally, set the container
this.setContainer(container);
}
}
// Always export a 'new' instance so it immediately evokes
export default new MyApp();
Note the lookup: ReactHabitat.default.Bootstrapper and ReactHabitat.default.Container()
So Babel does some magic with
export default
you can see how it conflicts here:https://github.com/Microsoft/TypeScript/issues/5565#issuecomment-155216760
Supposedly this is being addressed?
https://github.com/babel/babel/issues/2212
Anyway under typescript the example actually becomes:
Note the lookup:
ReactHabitat.default.Bootstrapper
andReactHabitat.default.Container()