Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. class Client extends React.Component {
  2.  
  3. constructor (props) {
  4. super(props);
  5. }
  6.  
  7. add(e){
  8. this.context.dispatch('ADD_ITEM', {name:'Marvin'});
  9. }
  10.  
  11. render() {
  12. return (
  13. <div>
  14. <h2>Client</h2>
  15. <p>List of all the clients</p>
  16. <button onClick={this.add}>Click Me</button>
  17. <ul>
  18. </ul>
  19. </div>
  20. );
  21. }
  22.  
  23.  
  24. }
  25.  
  26. Client.contextTypes = {
  27. dispatch: React.PropTypes.func.isRequired
  28. };
  29.  
  30. export default Client;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement