This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SyntheticEvent | |
| // 'this' inside your event handler refers to the component the event handler lives in | |
| class PlusButton extends React.Component { | |
| render(){ | |
| const buttonStyle= { | |
| fontSize: '1em', | |
| width: 30, | |
| height: 30, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const List = props => ( | |
| <ul> | |
| { | |
| props.items.map( (item, index) => <li key={index}>{item}</li> ) | |
| } | |
| </ul> | |
| ) | |
| class TodoList extends React.Component { | |
| constructor(props) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ColorCard extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = {color: ''}; | |
| this.handleSubmit = this.handleSubmit.bind(this); | |
| // this.handleChange = this.handleChange.bind(this); | |
| } | |
| handleSubmit(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PI | |
| @@TIME = 10000000 | |
| attr :circle, :square | |
| def initialize | |
| @circle = 0 | |
| @square = 0 | |
| calculate_pi | |
| end |
NewerOlder