Created
January 7, 2018 04:18
-
-
Save pporche87/e9f18ce7bfd7fbe67044b49d1d2ab547 to your computer and use it in GitHub Desktop.
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
import React, { Component } from 'react'; | |
import './queers.css'; | |
class Queers extends Component { | |
constructor() { | |
super() | |
this.state = { | |
queers: [] | |
} | |
} | |
componentDidMount() { | |
fetch('/api/queers') | |
.then(results => results.json()) | |
.then(queers => this.setState({queers}, () => console.log('Queer call..', queers))) | |
} | |
render() { | |
return ( | |
<div> | |
<h2>Queers</h2> | |
<ul> | |
{this.state.queers.map(queer => | |
<li key={queer.id}>{ queer.firstName } { queer.lastName } </li> | |
)} | |
</ul> | |
</div> | |
); | |
} | |
} | |
export default Queers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment