Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. var PropTypes = React.PropTypes;
  3.  
  4. function Item(props) {
  5.     console.log("onClickFunction: ", props.onClickFunction); //Here I can see the function
  6.     return  (
  7.         <div className="content">
  8.             <button className="ui" onClick={props.onClickFunction}>{props.category}</button>
  9.         </div>
  10.     );
  11. }
  12.  
  13. Item.propTypes = {
  14.   onClickFunction: PropTypes.func.isRequired,
  15.   category: PropTypes.string.isRequired
  16. }
  17.  
  18. export default Item;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement