Skip to content

Instantly share code, notes, and snippets.

class CityList extends Component {
state = {
cities: [
{
id: 1,
name: 'Boston',
},
{
id: 2,
name: 'Cambridge',
class City extends Component {
state = {
active: false,
}
handleClick = () => (
this.setState({
active: !this.state.active,
})
)