Skip to content

Instantly share code, notes, and snippets.

@prashaantt
Created December 2, 2016 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prashaantt/ec60821aaa0bb7147455f1b499808655 to your computer and use it in GitHub Desktop.
Save prashaantt/ec60821aaa0bb7147455f1b499808655 to your computer and use it in GitHub Desktop.
@inject("userStore")
@withRouter
@observer
class MyComponent extends React.Component<MyComponentProps, {}> {
get injected() {
return this.props as InjectedProps;
}
render() {
const { name, countryCode } = this.props;
const { userStore, router } = this.injected;
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment