This file contains 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 CityList extends Component { | |
state = { | |
cities: [ | |
{ | |
id: 1, | |
name: 'Boston', | |
}, | |
{ | |
id: 2, | |
name: 'Cambridge', |
This file contains 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 City extends Component { | |
state = { | |
active: false, | |
} | |
handleClick = () => ( | |
this.setState({ | |
active: !this.state.active, | |
}) | |
) |