Guest User

Untitled

a guest
Jul 11th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import { observer } from 'mobx-react';
  2. import * as React from 'react';
  3. import { AppViewModel } from './AppViewModel';
  4. @observer class App extends React.Component< {model: AppViewModel} ,{}> {
  5.  
  6. public render() {
  7. return (
  8. <div>
  9. <button onClick={this.props.model.refresh} >Refresh List</button>
  10. <button onClick={this.props.model.clearData} >Clear List</button>
  11.  
  12. <ol>
  13. {
  14. this.props.model.items
  15. .map(item => {
  16. return (
  17. <li key={item.name}>
  18. <ul>
  19. <li>Name: {item.name}</li>
  20. <li>Description: {item.description}</li>
  21. <li>Link: <a href={item.html_url}>Link</a></li>
  22. </ul>
  23. </li>
  24. );
  25. })
  26. }
  27. </ol>
  28. </div>
  29. );
  30. }
  31. }
  32.  
  33. export default App;
Add Comment
Please, Sign In to add comment