Last active
February 23, 2019 18:22
-
-
Save advorkina/6962381397395ca8f8703f2d949f04dc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { inject, observer } from 'mobx-react/native'; | |
// other imports | |
// because of the @inject line we will get observableStore to our props | |
// because of the @observer line the component will be rerendered each time store will get updated | |
@inject('observableStore') | |
@observer | |
export default class SubscribeComponent extends Component<{},{}> { | |
// bla bla bla code | |
render() { | |
// and here is the property!! | |
const property = this.props.observableStore.property; | |
const smthImportant = this.getSmthImportant(property); | |
return (<ChildComponent important={smthImportant}/>); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment