Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const React = require('react');
  2. const PropTypes = require('prop-types');
  3. const classNames = require('classnames');
  4.  
  5. class Row extends React.PureComponent {
  6.   constructor(props) {
  7.     super(props);
  8.     this.onClickHandler = this.onClickHandler.bind(this);
  9.   }
  10.  
  11.   onClickHandler(e) {
  12.     const { onClick } = this.props;
  13.  
  14.     onClick && onClick();
  15.   }
  16.  
  17.   render() {
  18.     const { onClick } = this.props;
  19.  
  20.     return (
  21.       <div className="" onClick={this.onClickHandler} role="presentation">
  22.         <p>any text</p>
  23.       </div>
  24.     );
  25.   }
  26. }
  27.  
  28. Row.propTypes = {
  29.   onClick: PropTypes.func,
  30. };
  31.  
  32. Row.defaultProps = {
  33.   onClick: null,
  34. };
  35.  
  36. module.exports = Row;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement