Skip to content

Instantly share code, notes, and snippets.

@marharyta
Last active July 17, 2018 13:05
Show Gist options
  • Save marharyta/2ec3e5b37d750d92e14810ab8c1902aa to your computer and use it in GitHub Desktop.
Save marharyta/2ec3e5b37d750d92e14810ab8c1902aa to your computer and use it in GitHub Desktop.
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