Skip to content

Instantly share code, notes, and snippets.

@melikhov-dev
Created October 27, 2017 19:37
Show Gist options
  • Save melikhov-dev/a70537910322eec7b393cfd129134ae8 to your computer and use it in GitHub Desktop.
Save melikhov-dev/a70537910322eec7b393cfd129134ae8 to your computer and use it in GitHub Desktop.
@observer
class Items extends Component {
render() {
return (
<div>
<ul>
{this.props.store.items.map((item) => <li>{item}</li>)}
</ul>
<button onClick={() => this.props.store.addItem('foo')}>
Add foo
</button>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment