Last active
March 23, 2019 13:16
-
-
Save Wicker25/a2cffba6950cbee8766a3a97e17dfb59 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
import React from 'react'; | |
import { inject, observer } from 'mobx-react'; | |
@inject('session') | |
@observer | |
export class MyComponent extends React.Component { | |
render() { | |
const { session } = this.props; | |
if (session.state === 'loading') { | |
return <Spinner /> | |
} | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment