Advertisement
Guest User

Untitled

a guest
Jan 8th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, {Component, PropTypes} from 'react';
  2. import {connectMultireducer} from 'multireducer';
  3. import {increment} from 'redux/modules/counter';
  4.  
  5. @connectMultireducer(
  6.   state => ({count: state.count}),
  7.   {increment})
  8. export default class CounterButton extends Component {
  9.   static propTypes = {
  10.     count: PropTypes.number,
  11.     increment: PropTypes.func.isRequired,
  12.     className: PropTypes.string
  13.   }
  14.  
  15.   props = {
  16.     className: ''
  17.   }
  18.  
  19.   render() {
  20.     const {count, increment} = this.props; // eslint-disable-line no-shadow
  21.     let {className} = this.props;
  22.     className += ' btn btn-default';
  23.     return (
  24.       <button className={className} onClick={increment}>
  25.         You have clicked me {count} time{count === 1 ? '' : 's'}.
  26.       </button>
  27.     );
  28.   }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement