Created
July 26, 2018 02:09
-
-
Save pkellner/602cebb1a61496367dec0412bbdae5b5 to your computer and use it in GitHub Desktop.
Componet/Speakers.js
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 SpeakersHeader from './SpeakersHeader'; | |
import SpeakerList from './SpeakerList'; | |
import axios from "axios"; | |
class Speakers extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
...props | |
}; | |
} | |
componentDidMount() { | |
axios.get("http://localhost:4000/rest/speakers") | |
.then(res => { | |
this.setState({ speakers: res.data,isLoading: false }); | |
}); | |
} | |
render() { | |
return ( | |
<div> | |
<SpeakersHeader/> | |
<SpeakerList {...this.state} /> | |
</div> | |
); | |
} | |
} | |
export default Speakers; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment