Last active
July 17, 2018 13:05
-
-
Save marharyta/2ec3e5b37d750d92e14810ab8c1902aa to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './css/main.css'; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { coworkings: [] }; | |
} | |
componentDidMount() { | |
fetch('https://api.myjson.com/bins/nwxou', { | |
headers: { | |
Accept: 'application/json', | |
'Content-Type': 'application/json' | |
} | |
}) | |
.then(res => res.json()) | |
.then(res => { | |
console.log(res); | |
}) | |
.catch(error => { | |
console.log(error); | |
}); | |
} | |
render() { | |
return <div> Hello, world! </div>; | |
} | |
} | |
const rootElement = document.getElementById('root'); | |
ReactDOM.render(<App />, rootElement); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment