Skip to content

Instantly share code, notes, and snippets.

@michaltakac
Created February 10, 2017 23:26
Show Gist options
  • Save michaltakac/e6e6c5221a0c910f3f47ef9d9ceaa23a to your computer and use it in GitHub Desktop.
Save michaltakac/e6e6c5221a0c910f3f47ef9d9ceaa23a to your computer and use it in GitHub Desktop.
barthackahton
class componentName extends Component {
constructor(props) {
this.state = {
spotreba: ''
}
}
componentWillMount() {
var self = this;
axios.get(url)
.then(function(response) {
self.setState({
spotreba: response.data
})
})
}
componentDidMount() {
}
render() {
return (
<div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment