This is my index.js:
import React from 'react';
import { Provider } from 'mobx-react';
import RootStore from './stores/RootStore';
ReactDOM.render( <Provider rootStore={ new RootStore() }><App/></Provider>, document.getElementById( 'root' ) );
This is my component:
import React, { Component } from 'react';
import { observer } from 'mobx-react';
class Painel extends Component {
render() {
return (
<div style={ styles.container }>
olá mundo!
</div>
)
}
}
const styles = {
container: {},
};
export default observer( Painel );
How do I get rootStore
in my component Painel
?