Created
November 17, 2016 15:48
-
-
Save GRardB/15c3a0d715a0e031481ab7eb089532b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// entry point | |
import * as React from 'react'; | |
import * as ReactDOM from 'react-dom'; | |
import { asMap, observable, useStrict } from 'mobx'; | |
import { Provider } from 'mobx-react'; | |
import { App } from './components/App'; | |
useStrict(true); | |
const store = observable(asMap({})); | |
ReactDOM.render( | |
<Provider store={store}> | |
<App /> | |
</Provider>, | |
document.getElementById('app') | |
); | |
// App.tsx | |
import * as React from 'react'; | |
import { action, observable } from 'mobx'; | |
import { inject, observer } from 'mobx-react'; | |
import DevTools from 'mobx-react-devtools'; | |
@inject('store') // i think this is correct? | |
@observer | |
export class App extends React.Component<??????, {}> { | |
render() { | |
return ( | |
<div> | |
<h1> | |
App | |
</h1> | |
<DevTools /> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment