Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class CoolReact extends React.Component {
  2.   constructor(props) {
  3.     super(props);
  4.     this.state = {
  5.       cool: false
  6.     }
  7.   }
  8.  
  9.   setCool = () => this.setState({cool: !this.state.cool});
  10.  
  11.   render() {
  12.     return <FunctionalComponent prop1={"Hi"} prop2={"Josh"}/>
  13.   }
  14. }
  15.  
  16. const FunctionalComponent = ({prop1, prop2}) => (
  17.   <div>
  18.     <span>{prop1} {prop2}</span>
  19.   </div>
  20. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement